diff --git a/.buildkite/pipeline-utils/test-failures/annotate.ts b/.buildkite/pipeline-utils/test-failures/annotate.ts index 8ac896c99434b..8397fa670af66 100644 --- a/.buildkite/pipeline-utils/test-failures/annotate.ts +++ b/.buildkite/pipeline-utils/test-failures/annotate.ts @@ -150,7 +150,7 @@ export const annotateTestFailures = async () => { } exec( - `buildkite-agent artifact download --include-retried-jobs "target/test_failures/*.json" "${failureDir}"` + `.buildkite/scripts/common/download_artifact.sh --include-retried-jobs "target/test_failures/*.json" "${failureDir}"` ); const failures: TestFailure[] = recursiveReadDir(failureDir) diff --git a/.buildkite/scripts/common/download_artifact.sh b/.buildkite/scripts/common/download_artifact.sh new file mode 100755 index 0000000000000..09f2d9e978a96 --- /dev/null +++ b/.buildkite/scripts/common/download_artifact.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -euo pipefail + +source "$(dirname "$0")/util.sh" +download_artifact "$@" diff --git a/.buildkite/scripts/common/util.sh b/.buildkite/scripts/common/util.sh index b25ba2c46213f..1ce05856ec6b7 100755 --- a/.buildkite/scripts/common/util.sh +++ b/.buildkite/scripts/common/util.sh @@ -168,3 +168,9 @@ npm_install_global() { npm install -g "$toInstall" && touch "$successFlag" fi } + +# Download an artifact using the buildkite-agent, takes the same arguments as https://buildkite.com/docs/agent/v3/cli-artifact#downloading-artifacts-usage +# times-out after 60 seconds and retries up to 3 times +download_artifact() { + retry 3 1 timeout 3m buildkite-agent artifact download "$@" +} diff --git a/.buildkite/scripts/download_build_artifacts.sh b/.buildkite/scripts/download_build_artifacts.sh index 1e7525fff25ea..dd0ae660543a8 100755 --- a/.buildkite/scripts/download_build_artifacts.sh +++ b/.buildkite/scripts/download_build_artifacts.sh @@ -2,13 +2,15 @@ set -euo pipefail +source "$(dirname "$0")/common/util.sh" + if [[ ! -d "$KIBANA_BUILD_LOCATION/bin" ]]; then echo '--- Downloading Distribution and Plugin artifacts' cd "$WORKSPACE" - 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}" + download_artifact kibana-default.tar.gz . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact 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/steps/artifacts/cloud.sh b/.buildkite/scripts/steps/artifacts/cloud.sh index d2d5785093f1e..5bf2285ab162a 100644 --- a/.buildkite/scripts/steps/artifacts/cloud.sh +++ b/.buildkite/scripts/steps/artifacts/cloud.sh @@ -4,12 +4,13 @@ set -euo pipefail .buildkite/scripts/bootstrap.sh +source "$(dirname "$0")/../../common/util.sh" source .buildkite/scripts/steps/artifacts/env.sh echo "--- Build and publish Cloud image" mkdir -p target -buildkite-agent artifact download "kibana-$FULL_VERSION-linux-x86_64.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" +download_artifact "kibana-$FULL_VERSION-linux-x86_64.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" node scripts/build \ --skip-initialize \ diff --git a/.buildkite/scripts/steps/artifacts/docker_context.sh b/.buildkite/scripts/steps/artifacts/docker_context.sh index 86c4361173a08..c50fb3e0524fd 100755 --- a/.buildkite/scripts/steps/artifacts/docker_context.sh +++ b/.buildkite/scripts/steps/artifacts/docker_context.sh @@ -4,6 +4,7 @@ set -euo pipefail .buildkite/scripts/bootstrap.sh +source "$(dirname "$0")/../../common/util.sh" source .buildkite/scripts/steps/artifacts/env.sh KIBANA_DOCKER_CONTEXT="${KIBANA_DOCKER_CONTEXT:="default"}" @@ -28,7 +29,7 @@ fi tar -xf "target/$DOCKER_CONTEXT_FILE" -C "$DOCKER_BUILD_FOLDER" cd $DOCKER_BUILD_FOLDER -buildkite-agent artifact download "kibana-$FULL_VERSION-linux-x86_64.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" +download_artifact "kibana-$FULL_VERSION-linux-x86_64.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" echo "--- Build context" docker build . diff --git a/.buildkite/scripts/steps/artifacts/publish.sh b/.buildkite/scripts/steps/artifacts/publish.sh index ed4cb5ca1d4b9..1caee4a0eb025 100644 --- a/.buildkite/scripts/steps/artifacts/publish.sh +++ b/.buildkite/scripts/steps/artifacts/publish.sh @@ -7,8 +7,8 @@ source .buildkite/scripts/steps/artifacts/env.sh echo "--- Download and verify artifacts" function download { - buildkite-agent artifact download "$1" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" - buildkite-agent artifact download "$1.sha512.txt" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact "$1" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact "$1.sha512.txt" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" sha512sum -c "$1.sha512.txt" rm "$1.sha512.txt" } @@ -40,7 +40,7 @@ download "kibana-$FULL_VERSION-windows-x86_64.zip" download "dependencies-$FULL_VERSION.csv" -cd - +cd - echo "--- Set artifact permissions" chmod -R a+r target/* diff --git a/.buildkite/scripts/steps/cloud/build_and_deploy.sh b/.buildkite/scripts/steps/cloud/build_and_deploy.sh index 05427de058225..6488eca2c9cd8 100755 --- a/.buildkite/scripts/steps/cloud/build_and_deploy.sh +++ b/.buildkite/scripts/steps/cloud/build_and_deploy.sh @@ -14,7 +14,7 @@ ECCTL_LOGS=$(mktemp --suffix ".json") echo "--- Download Kibana Distribution" mkdir -p ./target -buildkite-agent artifact download "kibana-$VERSION-linux-x86_64.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" +download_artifact "kibana-$VERSION-linux-x86_64.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" echo "--- Build Cloud Distribution" ELASTICSEARCH_MANIFEST_URL="https://storage.googleapis.com/kibana-ci-es-snapshots-daily/$(jq -r '.version' package.json)/manifest-latest-verified.json" diff --git a/.buildkite/scripts/steps/code_coverage/ftr_configs.sh b/.buildkite/scripts/steps/code_coverage/ftr_configs.sh index 1a5eafd2e901f..8aa619651e71e 100755 --- a/.buildkite/scripts/steps/code_coverage/ftr_configs.sh +++ b/.buildkite/scripts/steps/code_coverage/ftr_configs.sh @@ -28,7 +28,7 @@ configs="${FTR_CONFIG:-}" if [[ "$configs" == "" ]]; then echo "--- Downloading ftr test run order" - buildkite-agent artifact download ftr_run_order.json . + download_artifact ftr_run_order.json . configs=$(jq -r '.[env.FTR_CONFIG_GROUP_KEY].names[]' ftr_run_order.json) fi diff --git a/.buildkite/scripts/steps/code_coverage/ingest.sh b/.buildkite/scripts/steps/code_coverage/ingest.sh index 6632009346481..31a24981ce200 100755 --- a/.buildkite/scripts/steps/code_coverage/ingest.sh +++ b/.buildkite/scripts/steps/code_coverage/ingest.sh @@ -29,7 +29,7 @@ revolveBuildHashes() { } collectRan() { - buildkite-agent artifact download target/ran_files/* . + download_artifact target/ran_files/* . while read -r x; do ran=("${ran[@]}" "$(cat "$x")") @@ -51,7 +51,7 @@ fetchArtifacts() { local xs=("$@") for x in "${xs[@]}"; do - buildkite-agent artifact download "target/kibana-coverage/${x}/*" . + download_artifact "target/kibana-coverage/${x}/*" . done } diff --git a/.buildkite/scripts/steps/code_coverage/jest_parallel.sh b/.buildkite/scripts/steps/code_coverage/jest_parallel.sh index fd8ea61f2d220..ec2095b88963c 100755 --- a/.buildkite/scripts/steps/code_coverage/jest_parallel.sh +++ b/.buildkite/scripts/steps/code_coverage/jest_parallel.sh @@ -2,6 +2,7 @@ set -euo pipefail +source "$(dirname "$0")/../../common/util.sh" source .buildkite/scripts/steps/code_coverage/util.sh export JOB=$BUILDKITE_PARALLEL_JOB @@ -18,7 +19,7 @@ fi export TEST_TYPE echo "--- downloading jest test run order" -buildkite-agent artifact download jest_run_order.json . +download_artifact jest_run_order.json . configs=$(jq -r 'getpath([env.TEST_TYPE]) | .groups[env.JOB | tonumber].names | .[]' jest_run_order.json) echo "--- KIBANA_DIR: $KIBANA_DIR" diff --git a/.buildkite/scripts/steps/functional/scalability_dataset_extraction.sh b/.buildkite/scripts/steps/functional/scalability_dataset_extraction.sh index cb17393f5f423..86d067174ba8b 100755 --- a/.buildkite/scripts/steps/functional/scalability_dataset_extraction.sh +++ b/.buildkite/scripts/steps/functional/scalability_dataset_extraction.sh @@ -34,8 +34,8 @@ mkdir "${BUILD_ID}" tar -czf "${BUILD_ID}/scalability_traces.tar.gz" -C target scalability_traces buildkite-agent artifact upload "${BUILD_ID}/scalability_traces.tar.gz" # Upload Kibana build, plugins, commit sha and traces to the bucket -buildkite-agent artifact download kibana-default.tar.gz ./"${BUILD_ID}" -buildkite-agent artifact download kibana-default-plugins.tar.gz ./"${BUILD_ID}" +download_artifact kibana-default.tar.gz ./"${BUILD_ID}" +download_artifact kibana-default-plugins.tar.gz ./"${BUILD_ID}" echo "${BUILDKITE_COMMIT}" > "${BUILD_ID}/KIBANA_COMMIT_HASH" gsutil -m cp -r "${BUILD_ID}" "${GCS_BUCKET}" echo "--- Update reference to the latest CI build" diff --git a/.buildkite/scripts/steps/package_testing/test.sh b/.buildkite/scripts/steps/package_testing/test.sh index 5831f0d938b26..4a2b8a52525d6 100755 --- a/.buildkite/scripts/steps/package_testing/test.sh +++ b/.buildkite/scripts/steps/package_testing/test.sh @@ -2,6 +2,7 @@ set -euo pipefail +source "$(dirname "$0")/../../common/util.sh" .buildkite/scripts/bootstrap.sh echo "--- Package Testing for $TEST_PACKAGE" @@ -9,13 +10,13 @@ echo "--- Package Testing for $TEST_PACKAGE" mkdir -p target cd target if [[ "$TEST_PACKAGE" == "deb" ]]; then - buildkite-agent artifact download 'kibana-*-amd64.deb' . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact 'kibana-*-amd64.deb' . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" KIBANA_IP_ADDRESS="192.168.56.5" elif [[ "$TEST_PACKAGE" == "rpm" ]]; then - buildkite-agent artifact download 'kibana-*-x86_64.rpm' . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact 'kibana-*-x86_64.rpm' . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" KIBANA_IP_ADDRESS="192.168.56.6" elif [[ "$TEST_PACKAGE" == "docker" ]]; then - buildkite-agent artifact download "kibana-$KIBANA_PKG_VERSION*-docker-image.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact "kibana-$KIBANA_PKG_VERSION*-docker-image.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" KIBANA_IP_ADDRESS="192.168.56.7" fi cd .. diff --git a/.buildkite/scripts/steps/storybooks/build_and_upload.ts b/.buildkite/scripts/steps/storybooks/build_and_upload.ts index 4e3ff3c75c576..c91eb6a9b8375 100644 --- a/.buildkite/scripts/steps/storybooks/build_and_upload.ts +++ b/.buildkite/scripts/steps/storybooks/build_and_upload.ts @@ -17,6 +17,7 @@ const STORYBOOKS = [ 'ci_composite', 'cloud', 'coloring', + 'chart_icons', 'controls', 'custom_integrations', 'dashboard_enhanced', diff --git a/.buildkite/scripts/steps/test/ftr_configs.sh b/.buildkite/scripts/steps/test/ftr_configs.sh index 52450b30f995c..fca1f78469256 100755 --- a/.buildkite/scripts/steps/test/ftr_configs.sh +++ b/.buildkite/scripts/steps/test/ftr_configs.sh @@ -32,7 +32,7 @@ fi if [ "$configs" == "" ] && [ "$FTR_CONFIG_GROUP_KEY" != "" ]; then echo "--- downloading ftr test run order" - buildkite-agent artifact download ftr_run_order.json . + download_artifact ftr_run_order.json . configs=$(jq -r '.[env.FTR_CONFIG_GROUP_KEY].names[]' ftr_run_order.json) fi diff --git a/.buildkite/scripts/steps/test/jest_parallel.sh b/.buildkite/scripts/steps/test/jest_parallel.sh index 8ca025a3e6516..2c4474abe0b05 100755 --- a/.buildkite/scripts/steps/test/jest_parallel.sh +++ b/.buildkite/scripts/steps/test/jest_parallel.sh @@ -2,6 +2,7 @@ set -euo pipefail +source "$(dirname "$0")/../../common/util.sh" export JOB=${BUILDKITE_PARALLEL_JOB:-0} # a jest failure will result in the script returning an exit code of 10 @@ -20,7 +21,7 @@ fi export TEST_TYPE echo "--- downloading jest test run order" -buildkite-agent artifact download jest_run_order.json . +download_artifact jest_run_order.json . configs=$(jq -r 'getpath([env.TEST_TYPE]) | .groups[env.JOB | tonumber].names | .[]' jest_run_order.json) while read -r config; do diff --git a/.eslintrc.js b/.eslintrc.js index eb3488aa5caff..caa408887c499 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -72,7 +72,7 @@ const ELASTIC_LICENSE_HEADER = ` const SAFER_LODASH_SET_HEADER = ` /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See \`packages/elastic-safer-lodash-set/LICENSE\` for more information. + * See \`packages/kbn-safer-lodash-set/LICENSE\` for more information. */ `; @@ -81,7 +81,7 @@ const SAFER_LODASH_SET_LODASH_HEADER = ` * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See \`packages/elastic-safer-lodash-set/LICENSE\` for more information. + * See \`packages/kbn-safer-lodash-set/LICENSE\` for more information. */ `; @@ -90,7 +90,7 @@ const SAFER_LODASH_SET_DEFINITELYTYPED_HEADER = ` * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See \`packages/elastic-safer-lodash-set/LICENSE\` for more information. + * See \`packages/kbn-safer-lodash-set/LICENSE\` for more information. */ `; @@ -186,44 +186,44 @@ const RESTRICTED_IMPORTS = [ { name: 'lodash', importNames: ['set', 'setWith'], - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash.set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash.setwith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/setWith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/fp', importNames: ['set', 'setWith', 'assoc', 'assocPath'], - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/fp/set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/fp/setWith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/fp/assoc', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/fp/assocPath', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash', @@ -409,7 +409,7 @@ module.exports = { * safer-lodash-set package requires special license headers */ { - files: ['packages/elastic-safer-lodash-set/**/*.{js,mjs,ts,tsx}'], + files: ['packages/kbn-safer-lodash-set/**/*.{js,mjs,ts,tsx}'], rules: { '@kbn/eslint/require-license-header': [ 'error', @@ -438,7 +438,7 @@ module.exports = { }, { - files: ['packages/elastic-safer-lodash-set/test/*.{js,mjs,ts,tsx}'], + files: ['packages/kbn-safer-lodash-set/test/*.{js,mjs,ts,tsx}'], rules: { '@kbn/eslint/require-license-header': [ 'error', @@ -466,7 +466,7 @@ module.exports = { }, }, { - files: ['packages/elastic-safer-lodash-set/**/*.d.ts'], + files: ['packages/kbn-safer-lodash-set/**/*.d.ts'], rules: { '@kbn/eslint/require-license-header': [ 'error', @@ -734,7 +734,7 @@ module.exports = { * Harden specific rules */ { - files: ['test/harden/*.js', 'packages/elastic-safer-lodash-set/test/*.js'], + files: ['test/harden/*.js', 'packages/kbn-safer-lodash-set/test/*.js'], rules: { 'mocha/handle-done-callback': 'off', }, @@ -754,11 +754,11 @@ module.exports = { paths: [ { name: 'lodash.set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash.setwith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash.template', @@ -767,11 +767,11 @@ module.exports = { }, { name: 'lodash/set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/setWith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/template', @@ -786,12 +786,12 @@ module.exports = { { object: 'lodash', property: 'set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: '_', property: 'set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: 'lodash', @@ -808,32 +808,32 @@ module.exports = { { object: 'lodash', property: 'setWith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: '_', property: 'setWith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: 'lodash', property: 'assoc', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: '_', property: 'assoc', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: 'lodash', property: 'assocPath', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: '_', property: 'assocPath', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, ], }, diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 09484706c05e0..d1080cea722e2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -136,7 +136,7 @@ x-pack/plugins/files @elastic/kibana-app-services /src/apm.js @elastic/kibana-core @vigneshshanmugam /packages/kbn-apm-config-loader/ @elastic/kibana-core @vigneshshanmugam /src/core/types/elasticsearch @elastic/apm-ui -/packages/elastic-apm-synthtrace/ @elastic/apm-ui +/packages/kbn-apm-synthtrace/ @elastic/apm-ui /packages/kbn-shared-svg @elastic/apm-ui #CC# /src/plugins/apm_oss/ @elastic/apm-ui #CC# /x-pack/plugins/observability/ @elastic/apm-ui @@ -597,10 +597,10 @@ x-pack/plugins/security_solution/cypress/README.md @elastic/security-engineering x-pack/test/security_solution_cypress @elastic/security-engineering-productivity ## Security Solution sub teams - adaptive-workload-protection -x-pack/plugins/kubernetes_security @elastic/awp-platform -x-pack/plugins/session_view @elastic/awp-platform -x-pack/plugins/security_solution/public/common/components/sessions_viewer @elastic/awp-platform -x-pack/plugins/security_solution/public/kubernetes @elastic/awp-platform +x-pack/plugins/kubernetes_security @elastic/awp-viz +x-pack/plugins/session_view @elastic/awp-viz +x-pack/plugins/security_solution/public/common/components/sessions_viewer @elastic/awp-viz +x-pack/plugins/security_solution/public/kubernetes @elastic/awp-viz ## Security Solution sub teams - Protections Experience x-pack/plugins/threat_intelligence @elastic/protections-experience @@ -618,6 +618,7 @@ x-pack/test/threat_intelligence_cypress @elastic/protections-experience # Cloud Security Posture /x-pack/plugins/cloud_security_posture/ @elastic/kibana-cloud-security-posture /x-pack/plugins/security_solution/public/cloud_security_posture @elastic/kibana-cloud-security-posture +/x-pack/test/api_integration/apis/cloud_security_posture/ @elastic/kibana-cloud-security-posture # Security Solution onboarding tour /x-pack/plugins/security_solution/public/common/components/guided_onboarding @elastic/platform-onboarding @@ -669,7 +670,6 @@ x-pack/test/threat_intelligence_cypress @elastic/protections-experience # Application Experience ## Shared UX Team -/src/plugins/shared_ux/ @elastic/shared-ux /packages/shared-ux/ @elastic/shared-ux /packages/shared-ux-*/ @elastic/shared-ux diff --git a/.i18nrc.json b/.i18nrc.json index cee83a60c1fd2..28986568d5bf3 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -67,8 +67,6 @@ "savedObjectsManagement": "src/plugins/saved_objects_management", "server": "src/legacy/server", "share": "src/plugins/share", - "sharedUX": "src/plugins/shared_ux", - "sharedUXComponents": "packages/kbn-shared-ux-components/src", "sharedUXPackages": "packages/shared-ux", "coloring": "packages/kbn-coloring/src", "statusPage": "src/legacy/core_plugins/status_page", diff --git a/NOTICE.txt b/NOTICE.txt index b150cf5673b42..cb1205f317655 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -253,6 +253,32 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Portions of this code are licensed under the following license: For license information please see https://edge.fullstory.com/s/fs.js.LICENSE.txt +--- +This code includes a copy of the `normalize-path` +https://github.com/jonschlinkert/normalize-path/blob/52c3a95ebebc2d98c1ad7606cbafa7e658656899/index.js + +The MIT License (MIT) + +Copyright (c) 2014-2018, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + --- This product bundles bootstrap@3.3.6 which is available under a "MIT" license. diff --git a/api_docs/actions.devdocs.json b/api_docs/actions.devdocs.json index cd26846b4f499..615835f7b85a4 100644 --- a/api_docs/actions.devdocs.json +++ b/api_docs/actions.devdocs.json @@ -1594,7 +1594,7 @@ "label": "ActionParamsType", "description": [], "signature": [ - "{ readonly to: string[]; readonly message: string; readonly subject: string; readonly cc: string[]; readonly bcc: string[]; readonly kibanaFooterLink: Readonly<{} & { path: string; text: string; }>; }" + "{ readonly message: string; readonly to: 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, @@ -1622,7 +1622,7 @@ "label": "ActionParamsType", "description": [], "signature": [ - "{ readonly group?: string | undefined; readonly source?: string | undefined; readonly summary?: string | undefined; readonly component?: string | undefined; readonly timestamp?: string | undefined; readonly eventAction?: \"resolve\" | \"trigger\" | \"acknowledge\" | undefined; readonly dedupKey?: string | undefined; readonly severity?: \"error\" | \"warning\" | \"info\" | \"critical\" | undefined; readonly class?: string | undefined; }" + "{ readonly source?: string | undefined; readonly summary?: string | undefined; readonly group?: string | undefined; readonly component?: string | undefined; readonly timestamp?: string | undefined; readonly eventAction?: \"resolve\" | \"trigger\" | \"acknowledge\" | undefined; readonly dedupKey?: string | undefined; readonly severity?: \"error\" | \"warning\" | \"info\" | \"critical\" | undefined; readonly class?: string | undefined; }" ], "path": "x-pack/plugins/actions/server/builtin_action_types/pagerduty.ts", "deprecated": false, @@ -1706,7 +1706,7 @@ "label": "ActionParamsType", "description": [], "signature": [ - "Readonly<{} & { subAction: \"getFields\"; subActionParams: Readonly<{} & {}>; }> | Readonly<{} & { subAction: \"getIncident\"; subActionParams: Readonly<{} & { externalId: string; }>; }> | Readonly<{} & { subAction: \"handshake\"; subActionParams: Readonly<{} & {}>; }> | Readonly<{} & { subAction: \"pushToService\"; subActionParams: Readonly<{} & { incident: Readonly<{} & { name: string; description: string | null; externalId: string | null; incidentTypes: number[] | null; severityCode: number | null; }>; comments: Readonly<{} & { comment: string; commentId: string; }>[] | null; }>; }> | Readonly<{} & { subAction: \"incidentTypes\"; subActionParams: Readonly<{} & {}>; }> | Readonly<{} & { subAction: \"severity\"; subActionParams: Readonly<{} & {}>; }>" + "Readonly<{} & { subAction: \"getFields\"; subActionParams: Readonly<{} & {}>; }> | Readonly<{} & { subAction: \"getIncident\"; subActionParams: Readonly<{} & { externalId: string; }>; }> | Readonly<{} & { subAction: \"handshake\"; subActionParams: Readonly<{} & {}>; }> | Readonly<{} & { subAction: \"pushToService\"; subActionParams: Readonly<{} & { incident: Readonly<{} & { description: string | null; name: string; externalId: string | null; incidentTypes: number[] | null; severityCode: number | null; }>; comments: Readonly<{} & { comment: string; commentId: string; }>[] | null; }>; }> | Readonly<{} & { subAction: \"incidentTypes\"; subActionParams: Readonly<{} & {}>; }> | Readonly<{} & { subAction: \"severity\"; subActionParams: Readonly<{} & {}>; }>" ], "path": "x-pack/plugins/actions/server/builtin_action_types/resilient/index.ts", "deprecated": false, @@ -1758,17 +1758,7 @@ }, "<", "ActionTypeConfig", - ">>; delete: ({ id }: { id: string; }) => Promise<{}>; execute: ({ actionId, params, source, relatedSavedObjects, }: Omit<", - "ExecuteOptions", - ", \"request\">) => Promise<", - { - "pluginId": "actions", - "scope": "common", - "docId": "kibActionsPluginApi", - "section": "def-common.ActionTypeExecutorResult", - "text": "ActionTypeExecutorResult" - }, - ">; create: ({ action: { actionTypeId, name, config, secrets }, }: ", + ">>; delete: ({ id }: { id: string; }) => Promise<{}>; create: ({ action: { actionTypeId, name, config, secrets }, }: ", "CreateOptions", ") => Promise<", { @@ -1792,7 +1782,17 @@ }, "<", "ActionTypeConfig", - ">>; getAll: () => Promise<", + ">>; execute: ({ actionId, params, source, relatedSavedObjects, }: Omit<", + "ExecuteOptions", + ", \"request\">) => Promise<", + { + "pluginId": "actions", + "scope": "common", + "docId": "kibActionsPluginApi", + "section": "def-common.ActionTypeExecutorResult", + "text": "ActionTypeExecutorResult" + }, + ">; getAll: () => Promise<", { "pluginId": "actions", "scope": "server", diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 258050dbccd31..fb370fac704c4 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions title: "actions" image: https://source.unsplash.com/400x175/?github description: API docs for the actions plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] --- import actionsObj from './actions.devdocs.json'; diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index afa9ff0bcc6cf..c681b05886b0c 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings title: "advancedSettings" image: https://source.unsplash.com/400x175/?github description: API docs for the advancedSettings plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] --- import advancedSettingsObj from './advanced_settings.devdocs.json'; diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index 51ef1f2036946..bcec7684a470d 100644 --- a/api_docs/aiops.mdx +++ b/api_docs/aiops.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops title: "aiops" image: https://source.unsplash.com/400x175/?github description: API docs for the aiops plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] --- import aiopsObj from './aiops.devdocs.json'; diff --git a/api_docs/alerting.devdocs.json b/api_docs/alerting.devdocs.json index 395acb1aeec96..a71cca2e3d278 100644 --- a/api_docs/alerting.devdocs.json +++ b/api_docs/alerting.devdocs.json @@ -43,7 +43,7 @@ "The rule to view" ], "signature": [ - "{ params: never; tags: string[]; id: string; name: string; monitoring?: ", + "{ params: never; tags: string[]; id: string; monitoring?: ", { "pluginId": "alerting", "scope": "common", @@ -51,7 +51,7 @@ "section": "def-common.RuleMonitoring", "text": "RuleMonitoring" }, - " | undefined; enabled: boolean; actions: ", + " | undefined; name: string; enabled: boolean; actions: ", { "pluginId": "alerting", "scope": "common", @@ -1912,7 +1912,7 @@ "section": "def-server.PublicAlert", "text": "PublicAlert" }, - "; done: () => ", + "; hasReachedAlertLimit: () => boolean; done: () => ", "AlertFactoryDoneUtils", "; }" ], @@ -2396,7 +2396,7 @@ "label": "AlertingRulesConfig", "description": [], "signature": [ - "Pick[] | undefined; } & { actions: Readonly<{ connectorTypeOverrides?: Readonly<{ max?: number | undefined; } & { id: string; }>[] | undefined; } & { max: number; }>; }>; minimumScheduleInterval: Readonly<{} & { value: string; enforce: boolean; }>; }>, \"minimumScheduleInterval\"> & { isUsingSecurity: boolean; }" + "Pick[] | undefined; } & { actions: Readonly<{ connectorTypeOverrides?: Readonly<{ max?: number | undefined; } & { id: string; }>[] | undefined; } & { max: number; }>; alerts: Readonly<{} & { max: number; }>; }>; minimumScheduleInterval: Readonly<{} & { value: string; enforce: boolean; }>; }>, \"minimumScheduleInterval\"> & { isUsingSecurity: boolean; }" ], "path": "x-pack/plugins/alerting/server/config.ts", "deprecated": false, @@ -5325,6 +5325,17 @@ "path": "x-pack/plugins/alerting/common/rule.ts", "deprecated": false, "initialIsOpen": false + }, + { + "parentPluginId": "alerting", + "id": "def-common.RuleExecutionStatusWarningReasons", + "type": "Enum", + "tags": [], + "label": "RuleExecutionStatusWarningReasons", + "description": [], + "path": "x-pack/plugins/alerting/common/rule.ts", + "deprecated": false, + "initialIsOpen": false } ], "misc": [ @@ -5672,17 +5683,6 @@ "deprecated": false, "initialIsOpen": false }, - { - "parentPluginId": "alerting", - "id": "def-common.RuleExecutionStatusWarningReasons", - "type": "string", - "tags": [], - "label": "RuleExecutionStatusWarningReasons", - "description": [], - "path": "x-pack/plugins/alerting/common/rule.ts", - "deprecated": false, - "initialIsOpen": false - }, { "parentPluginId": "alerting", "id": "def-common.RuleNavigation", @@ -5817,7 +5817,7 @@ "label": "SanitizedRule", "description": [], "signature": [ - "{ params: Params; tags: string[]; id: string; name: string; monitoring?: ", + "{ params: Params; tags: string[]; id: string; monitoring?: ", { "pluginId": "alerting", "scope": "common", @@ -5825,7 +5825,7 @@ "section": "def-common.RuleMonitoring", "text": "RuleMonitoring" }, - " | undefined; enabled: boolean; actions: ", + " | undefined; name: string; enabled: boolean; actions: ", { "pluginId": "alerting", "scope": "common", diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index 7dd493647c123..815b17bb70560 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting title: "alerting" image: https://source.unsplash.com/400x175/?github description: API docs for the alerting plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.devdocs.json'; diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index c5aa500a17699..448a918e81d3c 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apm title: "apm" image: https://source.unsplash.com/400x175/?github description: API docs for the apm plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] --- import apmObj from './apm.devdocs.json'; diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index f32d92e4c7f22..c35d69909e4fb 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners title: "banners" image: https://source.unsplash.com/400x175/?github description: API docs for the banners plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners'] --- import bannersObj from './banners.devdocs.json'; diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index 8f45d44f412a0..0e4d1ce76d72b 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch title: "bfetch" image: https://source.unsplash.com/400x175/?github description: API docs for the bfetch plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch'] --- import bfetchObj from './bfetch.devdocs.json'; diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index 4c71fc524bafa..936a16e38a6d3 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/canvas title: "canvas" image: https://source.unsplash.com/400x175/?github description: API docs for the canvas plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas'] --- import canvasObj from './canvas.devdocs.json'; diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index c5475166191bc..cf2fb0c0e5c1b 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cases title: "cases" image: https://source.unsplash.com/400x175/?github description: API docs for the cases plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] --- import casesObj from './cases.devdocs.json'; diff --git a/api_docs/charts.devdocs.json b/api_docs/charts.devdocs.json index 96a9ad926a858..6658d572dadd5 100644 --- a/api_docs/charts.devdocs.json +++ b/api_docs/charts.devdocs.json @@ -280,279 +280,6 @@ "returnComment": [], "initialIsOpen": false }, - { - "parentPluginId": "charts", - "id": "def-public.getBrushFromChartBrushEventFn", - "type": "Function", - "tags": [], - "label": "getBrushFromChartBrushEventFn", - "description": [ - "\nHelper function to transform `@elastic/charts` brush event into brush action event" - ], - "signature": [ - "(table: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - }, - ", xAccessor: ", - "Accessor", - " | ", - "AccessorFn", - ") => ({ x: selectedRange }: ", - "XYBrushEvent", - ") => ", - { - "pluginId": "charts", - "scope": "public", - "docId": "kibChartsPluginApi", - "section": "def-public.BrushTriggerEvent", - "text": "BrushTriggerEvent" - } - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "charts", - "id": "def-public.getBrushFromChartBrushEventFn.$1", - "type": "Object", - "tags": [], - "label": "table", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - } - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "charts", - "id": "def-public.getBrushFromChartBrushEventFn.$2", - "type": "CompoundType", - "tags": [], - "label": "xAccessor", - "description": [], - "signature": [ - "Accessor", - " | ", - "AccessorFn", - "" - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromChartClickEventFn", - "type": "Function", - "tags": [], - "label": "getFilterFromChartClickEventFn", - "description": [ - "\nHelper function to transform `@elastic/charts` click event into filter action event\n" - ], - "signature": [ - "(table: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - }, - ", xAccessor: ", - "Accessor", - " | ", - "AccessorFn", - ", splitSeriesAccessorFnMap?: Map> | undefined, splitChartAccessor?: ", - "Accessor", - " | ", - "AccessorFn", - " | undefined, negate?: boolean) => (points: [", - "GeometryValue", - ", ", - "XYChartSeriesIdentifier", - "][]) => ", - { - "pluginId": "charts", - "scope": "public", - "docId": "kibChartsPluginApi", - "section": "def-public.ClickTriggerEvent", - "text": "ClickTriggerEvent" - } - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromChartClickEventFn.$1", - "type": "Object", - "tags": [], - "label": "table", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - } - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromChartClickEventFn.$2", - "type": "CompoundType", - "tags": [], - "label": "xAccessor", - "description": [], - "signature": [ - "Accessor", - " | ", - "AccessorFn", - "" - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromChartClickEventFn.$3", - "type": "Object", - "tags": [], - "label": "splitSeriesAccessorFnMap", - "description": [ - "needed when using `splitSeriesAccessors` as `AccessorFn`" - ], - "signature": [ - "Map> | undefined" - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": false - }, - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromChartClickEventFn.$4", - "type": "CompoundType", - "tags": [], - "label": "splitChartAccessor", - "description": [], - "signature": [ - "Accessor", - " | ", - "AccessorFn", - " | undefined" - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": false - }, - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromChartClickEventFn.$5", - "type": "boolean", - "tags": [], - "label": "negate", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromSeriesFn", - "type": "Function", - "tags": [], - "label": "getFilterFromSeriesFn", - "description": [ - "\nHelper function to get filter action event from series" - ], - "signature": [ - "(table: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - }, - ") => ({ splitAccessors, ...rest }: ", - "XYChartSeriesIdentifier", - ", splitSeriesAccessorFnMap?: Map> | undefined, splitChartAccessor?: ", - "Accessor", - " | ", - "AccessorFn", - " | undefined, negate?: boolean) => ", - { - "pluginId": "charts", - "scope": "public", - "docId": "kibChartsPluginApi", - "section": "def-public.ClickTriggerEvent", - "text": "ClickTriggerEvent" - } - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromSeriesFn.$1", - "type": "Object", - "tags": [], - "label": "table", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - } - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "charts", "id": "def-public.getHeatmapColors", @@ -914,7 +641,7 @@ "tags": [], "label": "BrushTriggerEvent", "description": [], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", + "path": "src/plugins/charts/public/index.ts", "deprecated": false, "children": [ { @@ -927,7 +654,7 @@ "signature": [ "\"brush\"" ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", + "path": "src/plugins/charts/public/index.ts", "deprecated": false }, { @@ -948,7 +675,7 @@ }, "; column: number; range: number[]; timeFieldName?: string | undefined; }" ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", + "path": "src/plugins/charts/public/index.ts", "deprecated": false } ], @@ -961,7 +688,7 @@ "tags": [], "label": "ClickTriggerEvent", "description": [], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", + "path": "src/plugins/charts/public/index.ts", "deprecated": false, "children": [ { @@ -974,7 +701,7 @@ "signature": [ "\"filter\"" ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", + "path": "src/plugins/charts/public/index.ts", "deprecated": false }, { @@ -995,7 +722,7 @@ }, ", \"rows\" | \"columns\">; column: number; row: number; value: any; }[]; timeFieldName?: string | undefined; negate?: boolean | undefined; }" ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", + "path": "src/plugins/charts/public/index.ts", "deprecated": false } ], diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 84b0e3bb58242..7f4b3027a61c8 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github description: API docs for the charts plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] --- import chartsObj from './charts.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 272 | 2 | 253 | 9 | +| 261 | 2 | 246 | 9 | ## Client diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index cdb39d776033c..030f78d1063cb 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloud title: "cloud" image: https://source.unsplash.com/400x175/?github description: API docs for the cloud plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] --- import cloudObj from './cloud.devdocs.json'; diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index ebed9e0ac5447..d833bb0e50cfc 100644 --- a/api_docs/cloud_security_posture.mdx +++ b/api_docs/cloud_security_posture.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture title: "cloudSecurityPosture" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudSecurityPosture plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture'] --- import cloudSecurityPostureObj from './cloud_security_posture.devdocs.json'; diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 2803de66a70a8..ffaacdcb0eb4f 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/console title: "console" image: https://source.unsplash.com/400x175/?github description: API docs for the console plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] --- import consoleObj from './console.devdocs.json'; diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index 51c0e9cc3590e..e9526ae69f446 100644 --- a/api_docs/controls.mdx +++ b/api_docs/controls.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/controls title: "controls" image: https://source.unsplash.com/400x175/?github description: API docs for the controls plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] --- import controlsObj from './controls.devdocs.json'; diff --git a/api_docs/core.devdocs.json b/api_docs/core.devdocs.json index a6f22147e3c40..a4b351471464c 100644 --- a/api_docs/core.devdocs.json +++ b/api_docs/core.devdocs.json @@ -5399,7 +5399,7 @@ "label": "size", "description": [], "signature": [ - "\"s\" | \"m\" | \"l\" | undefined" + "\"m\" | \"s\" | \"l\" | undefined" ], "path": "node_modules/@types/kbn__core-overlays-browser/index.d.ts", "deprecated": false @@ -9956,7 +9956,7 @@ "signature": [ "{ options?: string[] | number[] | undefined; type?: ", "UiSettingsType", - " | undefined; metric?: { type: string; name: string; } | undefined; name?: string | undefined; order?: number | undefined; value?: unknown; description?: string | undefined; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", + " | undefined; metric?: { type: string; name: string; } | undefined; value?: unknown; description?: string | undefined; name?: string | undefined; order?: number | undefined; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", "DeprecationSettings", " | undefined; }" ], @@ -10025,9 +10025,9 @@ "label": "SavedObjectsFindOptions", "description": [], "signature": [ - "{ type: string | string[]; filter?: any; search?: string | undefined; page?: number | undefined; aggs?: Record | undefined; fields?: string[] | undefined; perPage?: number | undefined; sortField?: string | undefined; searchFields?: string[] | undefined; hasReference?: ", + "> | undefined; fields?: string[] | undefined; page?: number | undefined; perPage?: number | undefined; sortField?: string | undefined; searchFields?: string[] | undefined; hasReference?: ", "SavedObjectsFindOptionsReference", " | ", "SavedObjectsFindOptionsReference", @@ -10123,7 +10123,7 @@ "signature": [ "Pick<", "Toast", - ", \"children\" | \"onError\" | \"color\" | \"className\" | \"lang\" | \"style\" | \"role\" | \"tabIndex\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChange\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClick\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"data-test-subj\" | \"hidden\" | \"security\" | \"defaultValue\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\"> & { title?: string | ", + ", \"children\" | \"onError\" | \"hidden\" | \"color\" | \"className\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\" | \"data-test-subj\"> & { title?: string | ", "MountPoint", " | undefined; text?: string | ", "MountPoint", @@ -10162,7 +10162,7 @@ "signature": [ "Pick<", "Toast", - ", \"children\" | \"onError\" | \"color\" | \"className\" | \"lang\" | \"style\" | \"role\" | \"tabIndex\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChange\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClick\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"data-test-subj\" | \"hidden\" | \"security\" | \"defaultValue\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\"> & { title?: string | ", + ", \"children\" | \"onError\" | \"hidden\" | \"color\" | \"className\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\" | \"data-test-subj\"> & { title?: string | ", "MountPoint", " | undefined; text?: string | ", "MountPoint", @@ -15798,7 +15798,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -15866,7 +15864,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -16878,6 +16876,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -20724,7 +20724,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -20792,7 +20790,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -21804,6 +21802,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -21927,7 +21927,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -21995,7 +21993,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -23007,6 +23005,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -24281,7 +24281,7 @@ "label": "level", "description": [], "signature": [ - "\"error\" | \"all\" | \"off\" | \"info\" | \"debug\" | \"trace\" | \"warn\" | \"fatal\"" + "\"error\" | \"all\" | \"info\" | \"debug\" | \"off\" | \"trace\" | \"warn\" | \"fatal\"" ], "path": "node_modules/@types/kbn__core-logging-server/index.d.ts", "deprecated": false @@ -26222,7 +26222,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -26290,7 +26288,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -27302,6 +27300,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -36951,7 +36951,7 @@ "label": "EcsEventType", "description": [], "signature": [ - "\"start\" | \"error\" | \"connection\" | \"end\" | \"group\" | \"user\" | \"info\" | \"admin\" | \"protocol\" | \"access\" | \"allowed\" | \"change\" | \"creation\" | \"deletion\" | \"denied\" | \"installation\"" + "\"start\" | \"error\" | \"connection\" | \"user\" | \"info\" | \"group\" | \"end\" | \"admin\" | \"protocol\" | \"access\" | \"allowed\" | \"change\" | \"creation\" | \"deletion\" | \"denied\" | \"installation\"" ], "path": "node_modules/@types/kbn__logging/index.d.ts", "deprecated": false, @@ -37019,7 +37019,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -37087,7 +37085,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -38099,6 +38097,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -39404,7 +39404,7 @@ "signature": [ "{ options?: string[] | number[] | undefined; type?: ", "UiSettingsType", - " | undefined; metric?: { type: string; name: string; } | undefined; name?: string | undefined; order?: number | undefined; value?: unknown; description?: string | undefined; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", + " | undefined; metric?: { type: string; name: string; } | undefined; value?: unknown; description?: string | undefined; name?: string | undefined; order?: number | undefined; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", "DeprecationSettings", " | undefined; }" ], diff --git a/api_docs/core.mdx b/api_docs/core.mdx index 5edc8bbadac04..c263ced17e2e2 100644 --- a/api_docs/core.mdx +++ b/api_docs/core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/core title: "core" image: https://source.unsplash.com/400x175/?github description: API docs for the core plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core'] --- import coreObj from './core.devdocs.json'; diff --git a/api_docs/core_application.devdocs.json b/api_docs/core_application.devdocs.json index 00b0c241fac11..30eaa3462a34a 100644 --- a/api_docs/core_application.devdocs.json +++ b/api_docs/core_application.devdocs.json @@ -2168,7 +2168,7 @@ "section": "def-public.AppStatus", "text": "AppStatus" }, - " | undefined; tooltip?: string | undefined; searchable?: boolean | undefined; deepLinks?: ", + " | undefined; searchable?: boolean | undefined; deepLinks?: ", { "pluginId": "core", "scope": "public", @@ -2184,7 +2184,7 @@ "section": "def-public.AppNavLinkStatus", "text": "AppNavLinkStatus" }, - " | undefined; defaultPath?: string | undefined; }" + " | undefined; defaultPath?: string | undefined; tooltip?: string | undefined; }" ], "path": "src/core/public/application/types.ts", "deprecated": false, diff --git a/api_docs/core_application.mdx b/api_docs/core_application.mdx index c3013b2b7edd7..0f737a23baba3 100644 --- a/api_docs/core_application.mdx +++ b/api_docs/core_application.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/core-application title: "core.application" image: https://source.unsplash.com/400x175/?github description: API docs for the core.application plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.application'] --- import coreApplicationObj from './core_application.devdocs.json'; diff --git a/api_docs/core_chrome.devdocs.json b/api_docs/core_chrome.devdocs.json index ddbd7175cd71a..a1c6878eef063 100644 --- a/api_docs/core_chrome.devdocs.json +++ b/api_docs/core_chrome.devdocs.json @@ -1912,7 +1912,7 @@ "signature": [ "React.HTMLAttributes & ", "CommonProps", - " & { href?: string | undefined; onClick?: React.MouseEventHandler | undefined; text: React.ReactNode; truncate?: boolean | undefined; color?: \"warning\" | \"primary\" | \"success\" | \"accent\" | \"danger\" | \"text\" | \"subdued\" | \"ghost\" | undefined; 'aria-current'?: boolean | \"date\" | \"location\" | \"true\" | \"false\" | \"page\" | \"step\" | \"time\" | undefined; }" + " & { href?: string | undefined; onClick?: React.MouseEventHandler | undefined; text: React.ReactNode; truncate?: boolean | undefined; color?: \"warning\" | \"subdued\" | \"primary\" | \"accent\" | \"success\" | \"danger\" | \"text\" | \"ghost\" | undefined; 'aria-current'?: boolean | \"date\" | \"location\" | \"time\" | \"page\" | \"false\" | \"true\" | \"step\" | undefined; }" ], "path": "src/core/public/chrome/types.ts", "deprecated": false, @@ -1926,9 +1926,9 @@ "label": "ChromeHelpExtensionLinkBase", "description": [], "signature": [ - "{ target?: string | (string & {}) | undefined; 'data-test-subj'?: string | undefined; iconType?: ", + "{ iconType?: ", "IconType", - " | undefined; rel?: string | undefined; }" + " | undefined; 'data-test-subj'?: string | undefined; rel?: string | undefined; target?: string | (string & {}) | undefined; }" ], "path": "src/core/public/chrome/ui/header/header_help_menu.tsx", "deprecated": false, diff --git a/api_docs/core_chrome.mdx b/api_docs/core_chrome.mdx index a5c42d679ba9b..3b4972563bed1 100644 --- a/api_docs/core_chrome.mdx +++ b/api_docs/core_chrome.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/core-chrome title: "core.chrome" image: https://source.unsplash.com/400x175/?github description: API docs for the core.chrome plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.chrome'] --- import coreChromeObj from './core_chrome.devdocs.json'; diff --git a/api_docs/core_saved_objects.mdx b/api_docs/core_saved_objects.mdx index 005028aeaedaf..9a8e01136ac2b 100644 --- a/api_docs/core_saved_objects.mdx +++ b/api_docs/core_saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/core-savedObjects title: "core.savedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the core.savedObjects plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.savedObjects'] --- import coreSavedObjectsObj from './core_saved_objects.devdocs.json'; diff --git a/api_docs/custom_integrations.devdocs.json b/api_docs/custom_integrations.devdocs.json index c6b9ecd132fea..a56430796e324 100644 --- a/api_docs/custom_integrations.devdocs.json +++ b/api_docs/custom_integrations.devdocs.json @@ -413,7 +413,7 @@ "label": "shipper", "description": [], "signature": [ - "\"other\" | \"beats\" | \"enterprise_search\" | \"language_clients\" | \"sample_data\" | \"tests\" | \"tutorial\" | \"placeholders\"" + "\"beats\" | \"enterprise_search\" | \"language_clients\" | \"other\" | \"sample_data\" | \"tests\" | \"tutorial\" | \"placeholders\"" ], "path": "src/plugins/custom_integrations/common/index.ts", "deprecated": false @@ -685,7 +685,7 @@ "label": "shipper", "description": [], "signature": [ - "\"other\" | \"beats\" | \"enterprise_search\" | \"language_clients\" | \"sample_data\" | \"tests\" | \"tutorial\" | \"placeholders\"" + "\"beats\" | \"enterprise_search\" | \"language_clients\" | \"other\" | \"sample_data\" | \"tests\" | \"tutorial\" | \"placeholders\"" ], "path": "src/plugins/custom_integrations/common/index.ts", "deprecated": false @@ -877,7 +877,7 @@ "\nThe list of all known shippers." ], "signature": [ - "(\"other\" | \"beats\" | \"enterprise_search\" | \"language_clients\" | \"sample_data\" | \"tests\" | \"tutorial\" | \"placeholders\")[]" + "(\"beats\" | \"enterprise_search\" | \"language_clients\" | \"other\" | \"sample_data\" | \"tests\" | \"tutorial\" | \"placeholders\")[]" ], "path": "src/plugins/custom_integrations/common/index.ts", "deprecated": false, @@ -893,7 +893,7 @@ "\nA shipper-- an internal or external system capable of storing data in ES/Kibana-- applicable to an Integration." ], "signature": [ - "\"other\" | \"beats\" | \"enterprise_search\" | \"language_clients\" | \"sample_data\" | \"tests\" | \"tutorial\" | \"placeholders\"" + "\"beats\" | \"enterprise_search\" | \"language_clients\" | \"other\" | \"sample_data\" | \"tests\" | \"tutorial\" | \"placeholders\"" ], "path": "src/plugins/custom_integrations/common/index.ts", "deprecated": false, diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index c157371844a7b..133041b0baec6 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/customIntegrations title: "customIntegrations" image: https://source.unsplash.com/400x175/?github description: API docs for the customIntegrations plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'customIntegrations'] --- import customIntegrationsObj from './custom_integrations.devdocs.json'; diff --git a/api_docs/dashboard.devdocs.json b/api_docs/dashboard.devdocs.json index 01decee7cd29b..32fc71a5d5c4c 100644 --- a/api_docs/dashboard.devdocs.json +++ b/api_docs/dashboard.devdocs.json @@ -2190,7 +2190,7 @@ "section": "def-common.RawSavedDashboardPanel730ToLatest", "text": "RawSavedDashboardPanel730ToLatest" }, - ", \"type\" | \"version\" | \"title\" | \"panelIndex\" | \"gridData\" | \"embeddableConfig\" | \"panelRefName\"> & { readonly id?: string | undefined; readonly type: string; }" + ", \"type\" | \"title\" | \"panelIndex\" | \"gridData\" | \"version\" | \"embeddableConfig\" | \"panelRefName\"> & { readonly id?: string | undefined; readonly type: string; }" ], "path": "src/plugins/dashboard/common/types.ts", "deprecated": false, @@ -2849,7 +2849,7 @@ "signature": [ "Pick<", "RawSavedDashboardPanel640To720", - ", \"version\" | \"title\" | \"panelIndex\" | \"gridData\" | \"embeddableConfig\"> & { readonly type?: string | undefined; readonly name?: string | undefined; panelIndex: string; panelRefName?: string | undefined; }" + ", \"title\" | \"panelIndex\" | \"gridData\" | \"version\" | \"embeddableConfig\"> & { readonly type?: string | undefined; readonly name?: string | undefined; panelIndex: string; panelRefName?: string | undefined; }" ], "path": "src/plugins/dashboard/common/bwc/types.ts", "deprecated": false, @@ -2865,7 +2865,7 @@ "signature": [ "Pick<", "RawSavedDashboardPanel610", - ", \"version\" | \"title\" | \"columns\" | \"sort\" | \"panelIndex\" | \"gridData\"> & { readonly id: string; readonly type: string; }" + ", \"columns\" | \"title\" | \"sort\" | \"panelIndex\" | \"gridData\" | \"version\"> & { readonly id: string; readonly type: string; }" ], "path": "src/plugins/dashboard/common/types.ts", "deprecated": false, @@ -2881,7 +2881,7 @@ "signature": [ "Pick<", "RawSavedDashboardPanel620", - ", \"version\" | \"title\" | \"columns\" | \"sort\" | \"panelIndex\" | \"gridData\" | \"embeddableConfig\"> & { readonly id: string; readonly type: string; }" + ", \"columns\" | \"title\" | \"sort\" | \"panelIndex\" | \"gridData\" | \"version\" | \"embeddableConfig\"> & { readonly id: string; readonly type: string; }" ], "path": "src/plugins/dashboard/common/types.ts", "deprecated": false, @@ -2897,7 +2897,7 @@ "signature": [ "Pick<", "RawSavedDashboardPanel620", - ", \"version\" | \"title\" | \"columns\" | \"sort\" | \"panelIndex\" | \"gridData\" | \"embeddableConfig\"> & { readonly id: string; readonly type: string; }" + ", \"columns\" | \"title\" | \"sort\" | \"panelIndex\" | \"gridData\" | \"version\" | \"embeddableConfig\"> & { readonly id: string; readonly type: string; }" ], "path": "src/plugins/dashboard/common/types.ts", "deprecated": false, @@ -2913,7 +2913,7 @@ "signature": [ "Pick<", "RawSavedDashboardPanel640To720", - ", \"version\" | \"title\" | \"panelIndex\" | \"gridData\" | \"embeddableConfig\"> & { readonly id: string; readonly type: string; }" + ", \"title\" | \"panelIndex\" | \"gridData\" | \"version\" | \"embeddableConfig\"> & { readonly id: string; readonly type: string; }" ], "path": "src/plugins/dashboard/common/types.ts", "deprecated": false, @@ -2935,7 +2935,7 @@ "section": "def-common.RawSavedDashboardPanel730ToLatest", "text": "RawSavedDashboardPanel730ToLatest" }, - ", \"type\" | \"version\" | \"title\" | \"panelIndex\" | \"gridData\" | \"embeddableConfig\" | \"panelRefName\"> & { readonly id?: string | undefined; readonly type: string; }" + ", \"type\" | \"title\" | \"panelIndex\" | \"gridData\" | \"version\" | \"embeddableConfig\" | \"panelRefName\"> & { readonly id?: string | undefined; readonly type: string; }" ], "path": "src/plugins/dashboard/common/types.ts", "deprecated": false, @@ -2951,7 +2951,7 @@ "signature": [ "Pick<", "RawSavedDashboardPanelTo60", - ", \"title\" | \"row\" | \"columns\" | \"sort\" | \"size_x\" | \"size_y\" | \"col\" | \"panelIndex\"> & { readonly id: string; readonly type: string; }" + ", \"columns\" | \"title\" | \"sort\" | \"size_x\" | \"size_y\" | \"row\" | \"col\" | \"panelIndex\"> & { readonly id: string; readonly type: string; }" ], "path": "src/plugins/dashboard/common/types.ts", "deprecated": false, diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index dec30d3bc8871..3796d5be1fdd8 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboard title: "dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboard plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] --- import dashboardObj from './dashboard.devdocs.json'; diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index 13d4f8126e622..e3603336d6f06 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboardEnhanced title: "dashboardEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboardEnhanced plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardEnhanced'] --- import dashboardEnhancedObj from './dashboard_enhanced.devdocs.json'; diff --git a/api_docs/data.devdocs.json b/api_docs/data.devdocs.json index 80cc604dd1014..78c8f4c0dec76 100644 --- a/api_docs/data.devdocs.json +++ b/api_docs/data.devdocs.json @@ -14907,7 +14907,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -14975,7 +14973,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -15987,6 +15985,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", diff --git a/api_docs/data.mdx b/api_docs/data.mdx index 03bb37f6c84e5..b432b21937d84 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data title: "data" image: https://source.unsplash.com/400x175/?github description: API docs for the data plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] --- import dataObj from './data.devdocs.json'; diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 43b17d6bcdc8a..d452015312014 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-query title: "data.query" image: https://source.unsplash.com/400x175/?github description: API docs for the data.query plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] --- import dataQueryObj from './data_query.devdocs.json'; diff --git a/api_docs/data_search.devdocs.json b/api_docs/data_search.devdocs.json index d7615605097df..73d0c6793eac8 100644 --- a/api_docs/data_search.devdocs.json +++ b/api_docs/data_search.devdocs.json @@ -2720,9 +2720,9 @@ "label": "options", "description": [], "signature": [ - "{ filter?: any; search?: string | undefined; page?: number | undefined; aggs?: Record | undefined; fields?: string[] | undefined; searchAfter?: string[] | undefined; perPage?: number | undefined; sortField?: string | undefined; sortOrder?: ", + "> | undefined; fields?: string[] | undefined; searchAfter?: string[] | undefined; page?: number | undefined; perPage?: number | undefined; sortField?: string | undefined; sortOrder?: ", "SortOrder", " | undefined; searchFields?: string[] | undefined; rootSearchFields?: string[] | undefined; hasReference?: ", "SavedObjectsFindOptionsReference", @@ -20481,7 +20481,7 @@ "label": "aggregate", "description": [], "signature": [ - "\"min\" | \"max\" | \"sum\" | \"concat\" | \"average\"" + "\"min\" | \"max\" | \"concat\" | \"sum\" | \"average\"" ], "path": "src/plugins/data/common/search/aggs/metrics/top_hit.ts", "deprecated": false @@ -28641,7 +28641,7 @@ "label": "GeoPoint", "description": [], "signature": [ - "string | [number, number] | Point" + "string | Point | [number, number]" ], "path": "src/plugins/data/common/search/expressions/geo_point.ts", "deprecated": false, diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index e737d151ee045..a38b65ac8f2b6 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-search title: "data.search" image: https://source.unsplash.com/400x175/?github description: API docs for the data.search plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] --- import dataSearchObj from './data_search.devdocs.json'; diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index 9c7c6cb955a50..246f0f1d56fa4 100644 --- a/api_docs/data_view_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewEditor title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewEditor plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] --- import dataViewEditorObj from './data_view_editor.devdocs.json'; diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx index 7aaccc5b1c59d..3b80d5cd6d62c 100644 --- a/api_docs/data_view_field_editor.mdx +++ b/api_docs/data_view_field_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewFieldEditor title: "dataViewFieldEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewFieldEditor plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewFieldEditor'] --- import dataViewFieldEditorObj from './data_view_field_editor.devdocs.json'; diff --git a/api_docs/data_view_management.mdx b/api_docs/data_view_management.mdx index d25bf068a9d39..a4c22013a7391 100644 --- a/api_docs/data_view_management.mdx +++ b/api_docs/data_view_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewManagement title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewManagement plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] --- import dataViewManagementObj from './data_view_management.devdocs.json'; diff --git a/api_docs/data_views.devdocs.json b/api_docs/data_views.devdocs.json index 5f33a31588605..8dd55e506010a 100644 --- a/api_docs/data_views.devdocs.json +++ b/api_docs/data_views.devdocs.json @@ -10910,7 +10910,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -10978,7 +10976,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -11990,6 +11988,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -16549,7 +16549,7 @@ "signature": [ "Pick<", "Toast", - ", \"children\" | \"onError\" | \"color\" | \"className\" | \"lang\" | \"style\" | \"role\" | \"tabIndex\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChange\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClick\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"data-test-subj\" | \"hidden\" | \"security\" | \"defaultValue\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\"> & { title?: string | ", + ", \"children\" | \"onError\" | \"hidden\" | \"color\" | \"className\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\" | \"data-test-subj\"> & { title?: string | ", "MountPoint", " | undefined; text?: string | ", "MountPoint", @@ -19748,7 +19748,7 @@ "label": "DataViewSavedObjectAttrs", "description": [], "signature": [ - "{ type?: string | undefined; name?: string | undefined; title: string; typeMeta?: string | undefined; }" + "{ type?: string | undefined; title: string; name?: string | undefined; typeMeta?: string | undefined; }" ], "path": "src/plugins/data_views/common/data_views/data_views.ts", "deprecated": false, @@ -20309,7 +20309,7 @@ "signature": [ "Pick<", "Toast", - ", \"children\" | \"onError\" | \"color\" | \"className\" | \"lang\" | \"style\" | \"role\" | \"tabIndex\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChange\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClick\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"data-test-subj\" | \"hidden\" | \"security\" | \"defaultValue\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\"> & { title?: string | ", + ", \"children\" | \"onError\" | \"hidden\" | \"color\" | \"className\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\" | \"data-test-subj\"> & { title?: string | ", "MountPoint", " | undefined; text?: string | ", "MountPoint", diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index 564788bc55c60..7245a253b5a4b 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViews title: "dataViews" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViews plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViews'] --- import dataViewsObj from './data_views.devdocs.json'; diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index 1f74b003d8e45..c9ce1886651f6 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataVisualizer title: "dataVisualizer" image: https://source.unsplash.com/400x175/?github description: API docs for the dataVisualizer plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index c713598dfe3af..af93c369b8bbe 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -47,18 +47,18 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | dataViewManagement | - | | | dataViewManagement | - | | | lens, observability, dataVisualizer, fleet, cloudSecurityPosture, discoverEnhanced, osquery, synthetics | - | -| | esUiShared, home, data, spaces, fleet, visualizations, lens, observability, ml, apm, indexLifecycleManagement, synthetics, upgradeAssistant, ux, savedObjectsManagement, kibanaOverview | - | +| | esUiShared, home, data, spaces, fleet, observability, ml, apm, indexLifecycleManagement, synthetics, upgradeAssistant, ux, savedObjectsManagement, kibanaOverview | - | | | management, spaces, ml, canvas, enterpriseSearch, osquery, home | - | -| | canvas, visTypeXy | - | +| | canvas | - | | | canvas | - | | | canvas | - | | | canvas | - | -| | canvas, visTypeXy | - | -| | canvas, visTypeXy | - | +| | canvas | - | +| | canvas | - | | | canvas | - | | | canvas | - | | | canvas | - | -| | canvas, visTypeXy | - | +| | canvas | - | | | management, enterpriseSearch | - | | | enterpriseSearch | - | | | actions, ml, savedObjectsTagging, enterpriseSearch | - | @@ -72,7 +72,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | apm, security, securitySolution | 8.8.0 | | | visualizations, dashboard, lens, maps, ml, securitySolution, security | 8.8.0 | | | securitySolution | 8.8.0 | -| | savedObjectsTaggingOss, visualizations, dashboard, lens | 8.8.0 | +| | savedObjectsTaggingOss, dashboard | 8.8.0 | | | dashboard | 8.8.0 | | | maps, dashboard | 8.8.0 | | | monitoring, kibanaUsageCollection, @kbn/core-metrics-server-internal | 8.8.0 | diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 9000dab98de1c..35c5b9e35340d 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -355,8 +355,6 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=indexPatternId) | - | -| | [workspace_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx#:~:text=RedirectAppLinks), [workspace_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx#:~:text=RedirectAppLinks), [workspace_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx#:~:text=RedirectAppLinks) | - | -| | [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject) | 8.8.0 | | | [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) | 8.8.0 | @@ -678,23 +676,10 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ -## visTypeXy - -| Deprecated API | Reference location(s) | Remove By | -| ---------------|-----------|-----------| -| | [xy_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts#:~:text=context) | - | -| | [xy_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts#:~:text=Render), [xy_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts#:~:text=Render) | - | -| | [xy_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts#:~:text=context) | - | -| | [xy_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts#:~:text=context) | - | - - - ## visualizations | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [get_table_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx#:~:text=RedirectAppLinks), [get_table_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx#:~:text=RedirectAppLinks), [get_table_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx#:~:text=RedirectAppLinks) | - | -| | [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject) | 8.8.0 | | | [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx#:~:text=onAppLeave), [visualize_editor_common.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx#:~:text=onAppLeave), [app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/app.tsx#:~:text=onAppLeave), [index.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/index.tsx#:~:text=onAppLeave) | 8.8.0 | diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index 3d2e1d7fedff8..212481753680f 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team description: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -190,6 +190,5 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| -| lens | | [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject) | 8.8.0 | | lens | | [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), [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx#:~:text=onAppLeave), [visualize_editor_common.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx#:~:text=onAppLeave), [app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/app.tsx#:~:text=onAppLeave), [index.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/index.tsx#:~:text=onAppLeave) | 8.8.0 | | management | | [application.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/management/public/application.tsx#:~:text=appBasePath) | 8.8.0 | \ No newline at end of file diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index 6db499a6362ef..d35c58ba11425 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/devTools title: "devTools" image: https://source.unsplash.com/400x175/?github description: API docs for the devTools plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'devTools'] --- import devToolsObj from './dev_tools.devdocs.json'; diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index 3aaad16eba9e5..341a8d0e8ff75 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discover title: "discover" image: https://source.unsplash.com/400x175/?github description: API docs for the discover plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discover'] --- import discoverObj from './discover.devdocs.json'; diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index 27c1255d91e0c..79bba874c8503 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discoverEnhanced title: "discoverEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the discoverEnhanced plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] --- import discoverEnhancedObj from './discover_enhanced.devdocs.json'; diff --git a/api_docs/elastic_apm_synthtrace.mdx b/api_docs/elastic_apm_synthtrace.mdx deleted file mode 100644 index dbdccb46eb2e4..0000000000000 --- a/api_docs/elastic_apm_synthtrace.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -#### -#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. -#### Reach out in #docs-engineering for more info. -#### -id: kibElasticApmSynthtracePluginApi -slug: /kibana-dev-docs/api/elastic-apm-synthtrace -title: "@elastic/apm-synthtrace" -image: https://source.unsplash.com/400x175/?github -description: API docs for the @elastic/apm-synthtrace plugin -date: 2022-08-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', '@elastic/apm-synthtrace'] ---- -import elasticApmSynthtraceObj from './elastic_apm_synthtrace.devdocs.json'; - -Elastic APM trace data generator - -Contact [Owner missing] for questions regarding this plugin. - -**Code health stats** - -| Public API count | Any count | Items lacking comments | Missing exports | -|-------------------|-----------|------------------------|-----------------| -| 74 | 0 | 74 | 11 | - -## Server - -### Objects - - -### Functions - - -### Classes - - -### Interfaces - - -### Enums - - -### Consts, variables and types - - diff --git a/api_docs/embeddable.devdocs.json b/api_docs/embeddable.devdocs.json index 15b274a52b3c1..fcc61f30bb223 100644 --- a/api_docs/embeddable.devdocs.json +++ b/api_docs/embeddable.devdocs.json @@ -8422,6 +8422,38 @@ ], "returnComment": [] }, + { + "parentPluginId": "embeddable", + "id": "def-public.IEmbeddable.updateOutput", + "type": "Function", + "tags": [], + "label": "updateOutput", + "description": [ + "\nUpdates output state with the given changes." + ], + "signature": [ + "(changes: Partial) => void" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "embeddable", + "id": "def-public.IEmbeddable.updateOutput.$1", + "type": "Object", + "tags": [], + "label": "changes", + "description": [], + "signature": [ + "Partial" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "embeddable", "id": "def-public.IEmbeddable.getInput$", diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 57abe09625332..32d11e69592e9 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddable title: "embeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddable plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] --- import embeddableObj from './embeddable.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 512 | 0 | 413 | 4 | +| 514 | 0 | 414 | 4 | ## Client diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index f2ddf4f374e82..490ab4a490165 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddableEnhanced title: "embeddableEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddableEnhanced plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] --- import embeddableEnhancedObj from './embeddable_enhanced.devdocs.json'; diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index 58e71135c73d1..3e280a9a3af49 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/encryptedSavedObjects title: "encryptedSavedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the encryptedSavedObjects plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] --- import encryptedSavedObjectsObj from './encrypted_saved_objects.devdocs.json'; diff --git a/api_docs/enterprise_search.devdocs.json b/api_docs/enterprise_search.devdocs.json index 4518c1110b7b1..7cf19747bfb19 100644 --- a/api_docs/enterprise_search.devdocs.json +++ b/api_docs/enterprise_search.devdocs.json @@ -14,6 +14,34 @@ "interfaces": [], "enums": [], "misc": [ + { + "parentPluginId": "enterpriseSearch", + "id": "def-server.ANALYTICS_COLLECTIONS_INDEX", + "type": "string", + "tags": [], + "label": "ANALYTICS_COLLECTIONS_INDEX", + "description": [], + "signature": [ + "\".elastic-analytics-collections\"" + ], + "path": "x-pack/plugins/enterprise_search/server/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "enterpriseSearch", + "id": "def-server.ANALYTICS_VERSION", + "type": "string", + "tags": [], + "label": "ANALYTICS_VERSION", + "description": [], + "signature": [ + "\"1\"" + ], + "path": "x-pack/plugins/enterprise_search/server/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "enterpriseSearch", "id": "def-server.ConfigType", diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index 62fb6919bd4ea..107f4985c9a1a 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/enterpriseSearch title: "enterpriseSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the enterpriseSearch plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] --- import enterpriseSearchObj from './enterprise_search.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-sea | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 6 | 0 | 6 | 0 | +| 8 | 0 | 8 | 0 | ## Server diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index 82943ca0f65da..8756693deb3d4 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esUiShared title: "esUiShared" image: https://source.unsplash.com/400x175/?github description: API docs for the esUiShared plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] --- import esUiSharedObj from './es_ui_shared.devdocs.json'; diff --git a/api_docs/event_annotation.devdocs.json b/api_docs/event_annotation.devdocs.json index 44dbbcb93afdb..45958ad9a1352 100644 --- a/api_docs/event_annotation.devdocs.json +++ b/api_docs/event_annotation.devdocs.json @@ -373,7 +373,7 @@ "label": "AvailableAnnotationIcon", "description": [], "signature": [ - "\"alert\" | \"circle\" | \"asterisk\" | \"bell\" | \"bolt\" | \"bug\" | \"editorComment\" | \"flag\" | \"heart\" | \"mapMarker\" | \"pinFilled\" | \"starEmpty\" | \"tag\" | \"triangle\"" + "\"circle\" | \"asterisk\" | \"alert\" | \"bell\" | \"bolt\" | \"bug\" | \"editorComment\" | \"flag\" | \"heart\" | \"mapMarker\" | \"pinFilled\" | \"starEmpty\" | \"tag\" | \"triangle\"" ], "path": "src/plugins/event_annotation/common/types.ts", "deprecated": false, @@ -847,7 +847,7 @@ "label": "options", "description": [], "signature": [ - "(\"alert\" | \"circle\" | \"asterisk\" | \"bell\" | \"bolt\" | \"bug\" | \"editorComment\" | \"flag\" | \"heart\" | \"mapMarker\" | \"pinFilled\" | \"starEmpty\" | \"tag\" | \"triangle\")[]" + "(\"circle\" | \"asterisk\" | \"alert\" | \"bell\" | \"bolt\" | \"bug\" | \"editorComment\" | \"flag\" | \"heart\" | \"mapMarker\" | \"pinFilled\" | \"starEmpty\" | \"tag\" | \"triangle\")[]" ], "path": "src/plugins/event_annotation/common/manual_event_annotation/index.ts", "deprecated": false diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index e893966f17b73..8bb87d9675760 100644 --- a/api_docs/event_annotation.mdx +++ b/api_docs/event_annotation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotation title: "eventAnnotation" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotation plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotation'] --- import eventAnnotationObj from './event_annotation.devdocs.json'; diff --git a/api_docs/event_log.devdocs.json b/api_docs/event_log.devdocs.json index ba50be14ed8cb..ec9ab9ec49812 100644 --- a/api_docs/event_log.devdocs.json +++ b/api_docs/event_log.devdocs.json @@ -1123,7 +1123,7 @@ "label": "data", "description": [], "signature": [ - "(Readonly<{ error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ version?: string | undefined; alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; } & {}> | undefined; uuid?: string | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | 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<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ id?: string | undefined; name?: string | undefined; version?: string | undefined; description?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; original?: string | undefined; outcome?: string | undefined; created?: string | undefined; category?: string[] | undefined; duration?: string | number | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined)[]" + "(Readonly<{ error?: Readonly<{ type?: string | undefined; message?: string | undefined; id?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; } & {}> | undefined; uuid?: string | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | 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<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; namespace?: string | undefined; id?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ id?: string | undefined; description?: 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; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; outcome?: string | undefined; created?: string | undefined; category?: string[] | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined)[]" ], "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", "deprecated": false @@ -1142,7 +1142,7 @@ "label": "IEvent", "description": [], "signature": [ - "DeepPartial | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ version?: string | undefined; alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; } & {}> | undefined; uuid?: string | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | 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<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ id?: string | undefined; name?: string | undefined; version?: string | undefined; description?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; original?: string | undefined; outcome?: string | undefined; created?: string | undefined; category?: string[] | undefined; duration?: string | number | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}>>> | undefined" + "DeepPartial | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; } & {}> | undefined; uuid?: string | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | 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<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; namespace?: string | undefined; id?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ id?: string | undefined; description?: 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; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; outcome?: string | undefined; created?: string | undefined; category?: string[] | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}>>> | undefined" ], "path": "x-pack/plugins/event_log/generated/schemas.ts", "deprecated": false, @@ -1156,7 +1156,7 @@ "label": "IValidatedEvent", "description": [], "signature": [ - "Readonly<{ error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ version?: string | undefined; alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; } & {}> | undefined; uuid?: string | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | 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<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ id?: string | undefined; name?: string | undefined; version?: string | undefined; description?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; original?: string | undefined; outcome?: string | undefined; created?: string | undefined; category?: string[] | undefined; duration?: string | number | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined" + "Readonly<{ error?: Readonly<{ type?: string | undefined; message?: string | undefined; id?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; } & {}> | undefined; uuid?: string | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | 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<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; namespace?: string | undefined; id?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ id?: string | undefined; description?: 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; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; outcome?: string | undefined; created?: string | undefined; category?: string[] | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined" ], "path": "x-pack/plugins/event_log/generated/schemas.ts", "deprecated": false, diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index bd71ece2b236e..accbeb8dd3cd1 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventLog title: "eventLog" image: https://source.unsplash.com/400x175/?github description: API docs for the eventLog plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] --- import eventLogObj from './event_log.devdocs.json'; diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index 4d823cdb8e567..27120b4b39baf 100644 --- a/api_docs/expression_error.mdx +++ b/api_docs/expression_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionError title: "expressionError" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionError plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] --- import expressionErrorObj from './expression_error.devdocs.json'; diff --git a/api_docs/expression_gauge.devdocs.json b/api_docs/expression_gauge.devdocs.json index f40fb1a95cd51..67065298ff9a6 100644 --- a/api_docs/expression_gauge.devdocs.json +++ b/api_docs/expression_gauge.devdocs.json @@ -349,76 +349,6 @@ ], "returnComment": [], "initialIsOpen": false - }, - { - "parentPluginId": "expressionGauge", - "id": "def-public.HorizontalBulletIcon", - "type": "Function", - "tags": [], - "label": "HorizontalBulletIcon", - "description": [], - "signature": [ - "({ title, titleId, ...props }: Omit<", - "EuiIconProps", - ", \"type\">) => JSX.Element" - ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/icons/horizontal_bullet_icon.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "expressionGauge", - "id": "def-public.HorizontalBulletIcon.$1", - "type": "Object", - "tags": [], - "label": "{ title, titleId, ...props }", - "description": [], - "signature": [ - "Omit<", - "EuiIconProps", - ", \"type\">" - ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/icons/horizontal_bullet_icon.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "expressionGauge", - "id": "def-public.VerticalBulletIcon", - "type": "Function", - "tags": [], - "label": "VerticalBulletIcon", - "description": [], - "signature": [ - "({ title, titleId, ...props }: Omit<", - "EuiIconProps", - ", \"type\">) => JSX.Element" - ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/icons/vertical_bullet_icon.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "expressionGauge", - "id": "def-public.VerticalBulletIcon.$1", - "type": "Object", - "tags": [], - "label": "{ title, titleId, ...props }", - "description": [], - "signature": [ - "Omit<", - "EuiIconProps", - ", \"type\">" - ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/icons/vertical_bullet_icon.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false } ], "interfaces": [], diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index 66453baeeba73..99f0e8a96126b 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionGauge plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] --- import expressionGaugeObj from './expression_gauge.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 61 | 0 | 61 | 2 | +| 57 | 0 | 57 | 2 | ## Client diff --git a/api_docs/expression_heatmap.devdocs.json b/api_docs/expression_heatmap.devdocs.json index 6cc1961115e4e..2838d206d03a2 100644 --- a/api_docs/expression_heatmap.devdocs.json +++ b/api_docs/expression_heatmap.devdocs.json @@ -2,43 +2,7 @@ "id": "expressionHeatmap", "client": { "classes": [], - "functions": [ - { - "parentPluginId": "expressionHeatmap", - "id": "def-public.HeatmapIcon", - "type": "Function", - "tags": [], - "label": "HeatmapIcon", - "description": [], - "signature": [ - "({ title, titleId, ...props }: Omit<", - "EuiIconProps", - ", \"type\">) => JSX.Element" - ], - "path": "src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_icon.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "expressionHeatmap", - "id": "def-public.HeatmapIcon.$1", - "type": "Object", - "tags": [], - "label": "{ title, titleId, ...props }", - "description": [], - "signature": [ - "Omit<", - "EuiIconProps", - ", \"type\">" - ], - "path": "src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_icon.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - } - ], + "functions": [], "interfaces": [], "enums": [], "misc": [], diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index 0dc876757633e..e89310339a2ff 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionHeatmap plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] --- import expressionHeatmapObj from './expression_heatmap.devdocs.json'; @@ -21,12 +21,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 107 | 0 | 103 | 3 | - -## Client - -### Functions - +| 105 | 0 | 101 | 3 | ## Common diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index e4d6f1e0cd682..b069a55c33ff3 100644 --- a/api_docs/expression_image.mdx +++ b/api_docs/expression_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionImage title: "expressionImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionImage plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionImage'] --- import expressionImageObj from './expression_image.devdocs.json'; diff --git a/api_docs/expression_legacy_metric_vis.mdx b/api_docs/expression_legacy_metric_vis.mdx index abebcb1ad9348..c43c215cd56e3 100644 --- a/api_docs/expression_legacy_metric_vis.mdx +++ b/api_docs/expression_legacy_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionLegacyMetricVis title: "expressionLegacyMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionLegacyMetricVis plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionLegacyMetricVis'] --- import expressionLegacyMetricVisObj from './expression_legacy_metric_vis.devdocs.json'; diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index 7ff4e733a5477..5cc3c2e272204 100644 --- a/api_docs/expression_metric.mdx +++ b/api_docs/expression_metric.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetric title: "expressionMetric" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetric plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] --- import expressionMetricObj from './expression_metric.devdocs.json'; diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index 4d1cadbaa3a11..a32beeda69a71 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetricVis plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] --- import expressionMetricVisObj from './expression_metric_vis.devdocs.json'; diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index f2dd6b2df11b0..58381a2c030d9 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionPartitionVis plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] --- import expressionPartitionVisObj from './expression_partition_vis.devdocs.json'; diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index 797a73d36677f..84d5978ec0717 100644 --- a/api_docs/expression_repeat_image.mdx +++ b/api_docs/expression_repeat_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRepeatImage title: "expressionRepeatImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRepeatImage plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRepeatImage'] --- import expressionRepeatImageObj from './expression_repeat_image.devdocs.json'; diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index 706a34aef5004..bb42d0c3c0ef8 100644 --- a/api_docs/expression_reveal_image.mdx +++ b/api_docs/expression_reveal_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRevealImage title: "expressionRevealImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRevealImage plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] --- import expressionRevealImageObj from './expression_reveal_image.devdocs.json'; diff --git a/api_docs/expression_shape.devdocs.json b/api_docs/expression_shape.devdocs.json index 5cb96923eb878..efd37d1f3b4d0 100644 --- a/api_docs/expression_shape.devdocs.json +++ b/api_docs/expression_shape.devdocs.json @@ -612,7 +612,7 @@ "label": "strokeLinecap", "description": [], "signature": [ - "\"inherit\" | \"butt\" | \"round\" | \"square\" | undefined" + "\"butt\" | \"round\" | \"square\" | \"inherit\" | undefined" ], "path": "src/plugins/expression_shape/public/components/reusable/types.tsx", "deprecated": false @@ -651,7 +651,7 @@ "label": "strokeLinejoin", "description": [], "signature": [ - "\"inherit\" | \"round\" | \"miter\" | \"bevel\" | undefined" + "\"round\" | \"inherit\" | \"miter\" | \"bevel\" | undefined" ], "path": "src/plugins/expression_shape/public/components/reusable/types.tsx", "deprecated": false diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index b9c99c3b2d0a0..aff78c3a8b5ce 100644 --- a/api_docs/expression_shape.mdx +++ b/api_docs/expression_shape.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionShape title: "expressionShape" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionShape plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionShape'] --- import expressionShapeObj from './expression_shape.devdocs.json'; diff --git a/api_docs/expression_tagcloud.mdx b/api_docs/expression_tagcloud.mdx index a2ae589dbfe35..0d7c788777029 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionTagcloud plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] --- import expressionTagcloudObj from './expression_tagcloud.devdocs.json'; diff --git a/api_docs/expression_x_y.devdocs.json b/api_docs/expression_x_y.devdocs.json index b1000cda6f9a8..a5afbe5ba1914 100644 --- a/api_docs/expression_x_y.devdocs.json +++ b/api_docs/expression_x_y.devdocs.json @@ -721,7 +721,7 @@ "label": "xScaleType", "description": [], "signature": [ - "\"time\" | \"linear\" | \"ordinal\"" + "\"linear\" | \"time\" | \"ordinal\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false @@ -788,7 +788,13 @@ "label": "decorations", "description": [], "signature": [ - "DataDecorationConfigResult", + { + "pluginId": "expressionXY", + "scope": "common", + "docId": "kibExpressionXYPluginApi", + "section": "def-common.DataDecorationConfigResult", + "text": "DataDecorationConfigResult" + }, "[] | undefined" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", @@ -1807,7 +1813,7 @@ "label": "AvailableReferenceLineIcon", "description": [], "signature": [ - "\"alert\" | \"circle\" | \"asterisk\" | \"bell\" | \"bolt\" | \"bug\" | \"editorComment\" | \"flag\" | \"heart\" | \"mapMarker\" | \"pinFilled\" | \"starEmpty\" | \"tag\" | \"triangle\" | \"empty\"" + "\"circle\" | \"asterisk\" | \"alert\" | \"bell\" | \"bolt\" | \"bug\" | \"editorComment\" | \"flag\" | \"heart\" | \"mapMarker\" | \"pinFilled\" | \"starEmpty\" | \"tag\" | \"triangle\" | \"empty\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false, @@ -2008,6 +2014,27 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "expressionXY", + "id": "def-common.DataDecorationConfigResult", + "type": "Type", + "tags": [], + "label": "DataDecorationConfigResult", + "description": [], + "signature": [ + { + "pluginId": "expressionXY", + "scope": "common", + "docId": "kibExpressionXYPluginApi", + "section": "def-common.DataDecorationConfig", + "text": "DataDecorationConfig" + }, + " & { type: \"dataDecorationConfig\"; }" + ], + "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "expressionXY", "id": "def-common.DataLayerConfig", @@ -2369,7 +2396,7 @@ "label": "XScaleType", "description": [], "signature": [ - "\"time\" | \"linear\" | \"ordinal\"" + "\"linear\" | \"time\" | \"ordinal\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false, @@ -2480,7 +2507,7 @@ "label": "YScaleType", "description": [], "signature": [ - "\"log\" | \"time\" | \"linear\" | \"sqrt\"" + "\"linear\" | \"log\" | \"time\" | \"sqrt\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false, diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index 3a84028be1ed5..72629a6cee2f0 100644 --- a/api_docs/expression_x_y.mdx +++ b/api_docs/expression_x_y.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionXY title: "expressionXY" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionXY plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] --- import expressionXYObj from './expression_x_y.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 151 | 0 | 141 | 12 | +| 152 | 0 | 142 | 11 | ## Client diff --git a/api_docs/expressions.devdocs.json b/api_docs/expressions.devdocs.json index 04f9f5ef5507d..f39f113576e2a 100644 --- a/api_docs/expressions.devdocs.json +++ b/api_docs/expressions.devdocs.json @@ -6980,7 +6980,7 @@ "\nTracks state of execution.\n\n- `not-started` - before .start() method was called.\n- `pending` - immediately after .start() method is called.\n- `result` - when expression execution completed.\n- `error` - when execution failed with error." ], "signature": [ - "\"error\" | \"result\" | \"not-started\" | \"pending\"" + "\"error\" | \"not-started\" | \"pending\" | \"result\"" ], "path": "src/plugins/expressions/common/execution/container.ts", "deprecated": false @@ -7966,10 +7966,6 @@ { "plugin": "canvas", "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts" - }, - { - "plugin": "visTypeXy", - "path": "src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts" } ] } @@ -10800,7 +10796,7 @@ "label": "padding", "description": [], "signature": [ - "\"s\" | \"m\" | \"l\" | \"xl\" | \"xs\" | undefined" + "\"m\" | \"s\" | \"xs\" | \"l\" | \"xl\" | undefined" ], "path": "src/plugins/expressions/public/react_expression_renderer/react_expression_renderer.tsx", "deprecated": false @@ -11601,7 +11597,7 @@ "\nAllowed column names in a PointSeries" ], "signature": [ - "\"color\" | \"size\" | \"x\" | \"y\" | \"text\"" + "\"color\" | \"size\" | \"text\" | \"y\" | \"x\"" ], "path": "src/plugins/expressions/common/expression_types/specs/pointseries.ts", "deprecated": false, @@ -17447,7 +17443,7 @@ "\nTracks state of execution.\n\n- `not-started` - before .start() method was called.\n- `pending` - immediately after .start() method is called.\n- `result` - when expression execution completed.\n- `error` - when execution failed with error." ], "signature": [ - "\"error\" | \"result\" | \"not-started\" | \"pending\"" + "\"error\" | \"not-started\" | \"pending\" | \"result\"" ], "path": "src/plugins/expressions/common/execution/container.ts", "deprecated": false @@ -18404,10 +18400,6 @@ { "plugin": "canvas", "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts" - }, - { - "plugin": "visTypeXy", - "path": "src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts" } ] } @@ -20629,7 +20621,7 @@ "\nAllowed column names in a PointSeries" ], "signature": [ - "\"color\" | \"size\" | \"x\" | \"y\" | \"text\"" + "\"color\" | \"size\" | \"text\" | \"y\" | \"x\"" ], "path": "src/plugins/expressions/common/expression_types/specs/pointseries.ts", "deprecated": false, @@ -28783,7 +28775,7 @@ "\nTracks state of execution.\n\n- `not-started` - before .start() method was called.\n- `pending` - immediately after .start() method is called.\n- `result` - when expression execution completed.\n- `error` - when execution failed with error." ], "signature": [ - "\"error\" | \"result\" | \"not-started\" | \"pending\"" + "\"error\" | \"not-started\" | \"pending\" | \"result\"" ], "path": "src/plugins/expressions/common/execution/container.ts", "deprecated": false @@ -30224,10 +30216,6 @@ { "plugin": "canvas", "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts" - }, - { - "plugin": "visTypeXy", - "path": "src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts" } ] } @@ -34711,7 +34699,7 @@ "label": "MathArguments", "description": [], "signature": [ - "{ expression: string; onError?: \"false\" | \"null\" | \"zero\" | \"throw\" | undefined; }" + "{ expression: string; onError?: \"null\" | \"zero\" | \"false\" | \"throw\" | undefined; }" ], "path": "src/plugins/expressions/common/expression_functions/specs/math.ts", "deprecated": false, @@ -34801,7 +34789,7 @@ "\nAllowed column names in a PointSeries" ], "signature": [ - "\"color\" | \"size\" | \"x\" | \"y\" | \"text\"" + "\"color\" | \"size\" | \"text\" | \"y\" | \"x\"" ], "path": "src/plugins/expressions/common/expression_types/specs/pointseries.ts", "deprecated": false, @@ -34915,14 +34903,6 @@ { "plugin": "canvas", "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/common/table.ts" - }, - { - "plugin": "visTypeXy", - "path": "src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts" - }, - { - "plugin": "visTypeXy", - "path": "src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts" } ], "initialIsOpen": false @@ -38717,7 +38697,7 @@ "label": "options", "description": [], "signature": [ - "(\"false\" | \"null\" | \"zero\" | \"throw\")[]" + "(\"null\" | \"zero\" | \"false\" | \"throw\")[]" ], "path": "src/plugins/expressions/common/expression_functions/specs/math.ts", "deprecated": false @@ -40317,7 +40297,7 @@ "label": "options", "description": [], "signature": [ - "(\"sum\" | \"min\" | \"max\" | \"average\")[]" + "(\"min\" | \"max\" | \"sum\" | \"average\")[]" ], "path": "src/plugins/expressions/common/expression_functions/specs/overall_metric.ts", "deprecated": false diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index d2d00300a7086..95486711230d5 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressions title: "expressions" image: https://source.unsplash.com/400x175/?github description: API docs for the expressions plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] --- import expressionsObj from './expressions.devdocs.json'; diff --git a/api_docs/features.mdx b/api_docs/features.mdx index dc38e8f481903..8801ae66f5f3f 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/features title: "features" image: https://source.unsplash.com/400x175/?github description: API docs for the features plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] --- import featuresObj from './features.devdocs.json'; diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index a6e5f83fd19a0..73e36008e12c9 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fieldFormats title: "fieldFormats" image: https://source.unsplash.com/400x175/?github description: API docs for the fieldFormats plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] --- import fieldFormatsObj from './field_formats.devdocs.json'; diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index 4d51f39421c5e..27a24293f037e 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fileUpload title: "fileUpload" image: https://source.unsplash.com/400x175/?github description: API docs for the fileUpload plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] --- import fileUploadObj from './file_upload.devdocs.json'; diff --git a/api_docs/files.devdocs.json b/api_docs/files.devdocs.json index 30338f59241eb..0bf3f06e2b7fa 100644 --- a/api_docs/files.devdocs.json +++ b/api_docs/files.devdocs.json @@ -180,6 +180,55 @@ } ] }, + { + "parentPluginId": "files", + "id": "def-public.FilesClient.find", + "type": "Function", + "tags": [], + "label": "find", + "description": [ + "\nFind a set of files given some filters.\n" + ], + "signature": [ + "(args: { kind?: string[] | undefined; name?: string[] | undefined; meta?: {} | undefined; extension?: string[] | undefined; status?: string[] | undefined; } & ", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.Pagination", + "text": "Pagination" + }, + ") => Promise<{ files: ", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.FileJSON", + "text": "FileJSON" + }, + "[]; }>" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "files", + "id": "def-public.FilesClient.find.$1", + "type": "CompoundType", + "tags": [], + "label": "args", + "description": [ + "- File filters" + ], + "signature": [ + "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"]" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false + } + ] + }, { "parentPluginId": "files", "id": "def-public.FilesClient.update", @@ -286,6 +335,246 @@ "deprecated": false } ] + }, + { + "parentPluginId": "files", + "id": "def-public.FilesClient.share", + "type": "Function", + "tags": [ + "note" + ], + "label": "share", + "description": [ + "\nShare a file by creating a new file share instance.\n" + ], + "signature": [ + "(args: { validUntil?: number | undefined; name?: string | undefined; } & { fileId: string; }) => Promise<", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.FileShareJSONWithToken", + "text": "FileShareJSONWithToken" + }, + ">" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "files", + "id": "def-public.FilesClient.share.$1", + "type": "CompoundType", + "tags": [], + "label": "args", + "description": [ + "- File share arguments" + ], + "signature": [ + "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"]" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "files", + "id": "def-public.FilesClient.unshare", + "type": "Function", + "tags": [], + "label": "unshare", + "description": [ + "\nDelete a file share instance.\n" + ], + "signature": [ + "(args: { id: string; }) => Promise<{ ok: true; }>" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "files", + "id": "def-public.FilesClient.unshare.$1", + "type": "CompoundType", + "tags": [], + "label": "args", + "description": [ + "- File unshare arguments" + ], + "signature": [ + "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"]" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "files", + "id": "def-public.FilesClient.getShare", + "type": "Function", + "tags": [], + "label": "getShare", + "description": [ + "\nGet a file share instance.\n" + ], + "signature": [ + "(args: { id: string; }) => Promise<{ share: ", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.FileShareJSON", + "text": "FileShareJSON" + }, + "; }>" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "files", + "id": "def-public.FilesClient.getShare.$1", + "type": "CompoundType", + "tags": [], + "label": "args", + "description": [ + "- Get file share arguments" + ], + "signature": [ + "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"]" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "files", + "id": "def-public.FilesClient.listShares", + "type": "Function", + "tags": [], + "label": "listShares", + "description": [ + "\nList all file shares. Optionally scoping to a specific\nfile.\n" + ], + "signature": [ + "(args: ", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.Pagination", + "text": "Pagination" + }, + " & { forFileId?: string | undefined; }) => Promise<{ shares: ", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.FileShareJSON", + "text": "FileShareJSON" + }, + "[]; }>" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "files", + "id": "def-public.FilesClient.listShares.$1", + "type": "CompoundType", + "tags": [], + "label": "args", + "description": [ + "- Get file share arguments" + ], + "signature": [ + "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"]" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "files", + "id": "def-public.FilesClient.getMetrics", + "type": "Function", + "tags": [], + "label": "getMetrics", + "description": [ + "\nGet metrics of file system, like storage usage.\n" + ], + "signature": [ + "(args: unknown) => Promise<", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.FilesMetrics", + "text": "FilesMetrics" + }, + ">" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "files", + "id": "def-public.FilesClient.getMetrics.$1", + "type": "CompoundType", + "tags": [], + "label": "args", + "description": [ + "- Get metrics arguments" + ], + "signature": [ + "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"]" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "files", + "id": "def-public.FilesClient.publicDownload", + "type": "Function", + "tags": [], + "label": "publicDownload", + "description": [ + "\nDownload a file, bypassing regular security by way of a\nsecret share token.\n" + ], + "signature": [ + "(args: { fileName?: string | undefined; } & { token: string; }) => Promise" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "files", + "id": "def-public.FilesClient.publicDownload.$1", + "type": "CompoundType", + "tags": [], + "label": "args", + "description": [ + "- Get public download arguments." + ], + "signature": [ + "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"]" + ], + "path": "x-pack/plugins/files/public/types.ts", + "deprecated": false + } + ] } ], "initialIsOpen": false @@ -512,7 +801,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -580,7 +867,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -1592,6 +1879,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -1929,22 +2218,12 @@ "children": [ { "parentPluginId": "files", - "id": "def-server.DeleteForFileArgs.file", - "type": "Object", + "id": "def-server.DeleteForFileArgs.id", + "type": "string", "tags": [], - "label": "file", + "label": "id", "description": [ - "\nThe file object to delete the shares for." - ], - "signature": [ - { - "pluginId": "files", - "scope": "common", - "docId": "kibFilesPluginApi", - "section": "def-common.File", - "text": "File" - }, - "" + "\nThe file id to delete the shares for." ], "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false @@ -1961,7 +2240,7 @@ "description": [ "\nWraps the {@link FileMetadataClient} and {@link BlobStorageClient} client\nto provide basic file CRUD functionality.\n\nFor now this is just a shallow type of the implementation for export purposes." ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "children": [ { @@ -1973,7 +2252,7 @@ "description": [ "See {@link FileMetadata.FileKind}." ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false }, { @@ -1986,19 +2265,19 @@ "\nSee {@link FileMetadataClient.create}.\n" ], "signature": [ - "(arg: ", + "(arg: ", "CreateArgs", ") => Promise<", { "pluginId": "files", - "scope": "server", + "scope": "common", "docId": "kibFilesPluginApi", - "section": "def-server.FileDescriptor", - "text": "FileDescriptor" + "section": "def-common.File", + "text": "File" }, - ">" + ">" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "children": [ { @@ -2013,7 +2292,7 @@ "signature": [ "CreateArgs" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "isRequired": true } @@ -2030,7 +2309,7 @@ "\nSee {@link FileMetadataClient.get}\n" ], "signature": [ - "(arg: ", + "(arg: ", { "pluginId": "files", "scope": "server", @@ -2041,16 +2320,15 @@ ") => Promise<", { "pluginId": "files", - "scope": "server", + "scope": "common", "docId": "kibFilesPluginApi", - "section": "def-server.FileDescriptor", - "text": "FileDescriptor" + "section": "def-common.File", + "text": "File" }, - ">" + ">" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "files", @@ -2070,10 +2348,12 @@ "text": "GetArg" } ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", - "deprecated": false + "path": "x-pack/plugins/files/server/file_client/types.ts", + "deprecated": false, + "isRequired": true } - ] + ], + "returnComment": [] }, { "parentPluginId": "files", @@ -2085,51 +2365,60 @@ "\n{@link FileMetadataClient.update}\n" ], "signature": [ - "(arg: ", - { - "pluginId": "files", - "scope": "server", - "docId": "kibFilesPluginApi", - "section": "def-server.UpdateArgs", - "text": "UpdateArgs" - }, - ") => Promise<", + "(id: string, metadata: ", { "pluginId": "files", - "scope": "server", + "scope": "common", "docId": "kibFilesPluginApi", - "section": "def-server.FileDescriptor", - "text": "FileDescriptor" + "section": "def-common.UpdatableFileMetadata", + "text": "UpdatableFileMetadata" }, - ">" + ") => Promise" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "files", "id": "def-server.FileClient.update.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "- File id" + ], + "signature": [ + "string" + ], + "path": "x-pack/plugins/files/server/file_client/types.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "files", + "id": "def-server.FileClient.update.$2", "type": "Object", "tags": [], - "label": "arg", + "label": "metadata", "description": [ - "- Argument to get a file" + "- new file metadata" ], "signature": [ { "pluginId": "files", - "scope": "server", + "scope": "common", "docId": "kibFilesPluginApi", - "section": "def-server.UpdateArgs", - "text": "UpdateArgs" + "section": "def-common.UpdatableFileMetadata", + "text": "UpdatableFileMetadata" }, - "" + "" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", - "deprecated": false + "path": "x-pack/plugins/files/server/file_client/types.ts", + "deprecated": false, + "isRequired": true } - ] + ], + "returnComment": [] }, { "parentPluginId": "files", @@ -2151,7 +2440,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "children": [ { @@ -2172,43 +2461,13 @@ "text": "DeleteArgs" } ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "isRequired": true } ], "returnComment": [] }, - { - "parentPluginId": "files", - "id": "def-server.FileClient.deleteContent", - "type": "Function", - "tags": [], - "label": "deleteContent", - "description": [ - "\nSee {@link BlobStorageClient.delete}\n" - ], - "signature": [ - "(id: string) => Promise" - ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "files", - "id": "def-server.FileClient.deleteContent.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "- Argument to delete a file" - ], - "path": "x-pack/plugins/files/server/blob_storage_service/types.ts", - "deprecated": false - } - ] - }, { "parentPluginId": "files", "id": "def-server.FileClient.list", @@ -2230,16 +2489,15 @@ " | undefined) => Promise<", { "pluginId": "files", - "scope": "server", + "scope": "common", "docId": "kibFilesPluginApi", - "section": "def-server.FileDescriptor", - "text": "FileDescriptor" + "section": "def-common.File", + "text": "File" }, "[]>" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "files", @@ -2260,10 +2518,12 @@ }, " | undefined" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", - "deprecated": false + "path": "x-pack/plugins/files/server/file_client/types.ts", + "deprecated": false, + "isRequired": false } - ] + ], + "returnComment": [] }, { "parentPluginId": "files", @@ -2286,16 +2546,15 @@ ") => Promise<", { "pluginId": "files", - "scope": "server", + "scope": "common", "docId": "kibFilesPluginApi", - "section": "def-server.FileDescriptor", - "text": "FileDescriptor" + "section": "def-common.File", + "text": "File" }, "[]>" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "files", @@ -2315,113 +2574,147 @@ "text": "FindFileArgs" } ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", - "deprecated": false + "path": "x-pack/plugins/files/server/file_client/types.ts", + "deprecated": false, + "isRequired": true } - ] + ], + "returnComment": [] }, { "parentPluginId": "files", - "id": "def-server.FileClient.upload", + "id": "def-server.FileClient.share", "type": "Function", - "tags": [], - "label": "upload", + "tags": [ + "note" + ], + "label": "share", "description": [ - "\nSee {@link BlobStorageClient.upload}\n" + "\nCreate a file share instance for this file.\n" ], "signature": [ - "(id: string, rs: ", - "Readable", - ", opts?: ", - "UploadOptions", - " | undefined) => Promise<{ id: string; size: number; }>" + "(args: ", + "ShareArgs", + ") => Promise<", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.FileShareJSONWithToken", + "text": "FileShareJSONWithToken" + }, + ">" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "children": [ { "parentPluginId": "files", - "id": "def-server.FileClient.upload.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "- Readable stream to upload" - ], - "signature": [ - "string" - ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "files", - "id": "def-server.FileClient.upload.$2", + "id": "def-server.FileClient.share.$1", "type": "Object", "tags": [], - "label": "rs", + "label": "args", "description": [ - "- Readable stream to upload" + "- Arguments to create a file share" ], "signature": [ - "Readable" + "ShareArgs" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "isRequired": true - }, + } + ], + "returnComment": [] + }, + { + "parentPluginId": "files", + "id": "def-server.FileClient.unshare", + "type": "Function", + "tags": [ + "note" + ], + "label": "unshare", + "description": [ + "\nCreate a file share instance for this file.\n" + ], + "signature": [ + "(args: IdArg) => Promise" + ], + "path": "x-pack/plugins/files/server/file_client/types.ts", + "deprecated": false, + "returnComment": [], + "children": [ { "parentPluginId": "files", - "id": "def-server.FileClient.upload.$3", + "id": "def-server.FileClient.unshare.$1", "type": "Object", "tags": [], - "label": "opts", + "label": "args", "description": [ - "- Argument for uploads" + "- Arguments to remove a file share" ], "signature": [ - "UploadOptions", - " | undefined" + "IdArg" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", - "deprecated": false, - "isRequired": false + "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "deprecated": false } - ], - "returnComment": [] + ] }, { "parentPluginId": "files", - "id": "def-server.FileClient.download", + "id": "def-server.FileClient.listShares", "type": "Function", - "tags": [], - "label": "download", + "tags": [ + "note" + ], + "label": "listShares", "description": [ - "\nSee {@link BlobStorageClient.download}\n" + "\nCreate a file share instance for this file.\n" ], "signature": [ - "(args: { id: string; size?: number | undefined; }) => Promise<", - "Readable", - ">" + "(arg: ", + { + "pluginId": "files", + "scope": "server", + "docId": "kibFilesPluginApi", + "section": "def-server.ListArgs", + "text": "ListArgs" + }, + ") => Promise<{ shares: ", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.FileShareJSON", + "text": "FileShareJSON" + }, + "[]; }>" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "returnComment": [], "children": [ { "parentPluginId": "files", - "id": "def-server.FileClient.download.$1", + "id": "def-server.FileClient.listShares.$1", "type": "Object", "tags": [], - "label": "args", + "label": "arg", "description": [ - "- to download a file" + "- Arguments to remove a file share" ], "signature": [ - "{ id: string; size?: number | undefined; }" + { + "pluginId": "files", + "scope": "server", + "docId": "kibFilesPluginApi", + "section": "def-server.ListArgs", + "text": "ListArgs" + } ], - "path": "x-pack/plugins/files/server/blob_storage_service/types.ts", + "path": "x-pack/plugins/files/server/file_share_service/types.ts", "deprecated": false } ] @@ -3063,7 +3356,7 @@ "\nUpdate updatable file attributes like name and meta.\n" ], "signature": [ - "(args: ", + "(args: ", { "pluginId": "files", "scope": "server", @@ -3071,15 +3364,7 @@ "section": "def-server.UpdateFileArgs", "text": "UpdateFileArgs" }, - ") => Promise<", - { - "pluginId": "files", - "scope": "common", - "docId": "kibFilesPluginApi", - "section": "def-common.File", - "text": "File" - }, - ">" + ") => Promise" ], "path": "x-pack/plugins/files/server/file_service/file_service.ts", "deprecated": false, @@ -4514,19 +4799,45 @@ "section": "def-common.File", "text": "File" }, - " extends ", - { - "pluginId": "files", - "scope": "common", - "docId": "kibFilesPluginApi", - "section": "def-common.FileJSON", - "text": "FileJSON" - }, "" ], "path": "x-pack/plugins/files/common/types.ts", "deprecated": false, "children": [ + { + "parentPluginId": "files", + "id": "def-common.File.id", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "\nThe file ID" + ], + "path": "x-pack/plugins/files/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "files", + "id": "def-common.File.data", + "type": "Object", + "tags": [], + "label": "data", + "description": [ + "\nFile metadata in camelCase form." + ], + "signature": [ + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.FileJSON", + "text": "FileJSON" + }, + "" + ], + "path": "x-pack/plugins/files/common/types.ts", + "deprecated": false + }, { "parentPluginId": "files", "id": "def-common.File.update", @@ -4597,7 +4908,15 @@ "signature": [ "(content: ", "Readable", - ") => Promise" + ") => Promise<", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.File", + "text": "File" + }, + ">" ], "path": "x-pack/plugins/files/common/types.ts", "deprecated": false, diff --git a/api_docs/files.mdx b/api_docs/files.mdx index c82b21c7180f8..4fa0f071191b4 100644 --- a/api_docs/files.mdx +++ b/api_docs/files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/files title: "files" image: https://source.unsplash.com/400x175/?github description: API docs for the files plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'files'] --- import filesObj from './files.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/tea | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 222 | 0 | 3 | 2 | +| 237 | 0 | 3 | 2 | ## Client diff --git a/api_docs/fleet.devdocs.json b/api_docs/fleet.devdocs.json index ca2f3009b3032..b082176e571a3 100644 --- a/api_docs/fleet.devdocs.json +++ b/api_docs/fleet.devdocs.json @@ -3933,7 +3933,7 @@ "signature": [ "(soClient: ", "SavedObjectsClientContract", - ", ids: string[], options?: { fields?: string[] | undefined; }) => Promise<", + ", ids: string[], options?: { fields?: string[] | undefined; withPackagePolicies?: boolean | undefined; ignoreMissing?: boolean | undefined; }) => Promise<", { "pluginId": "fleet", "scope": "common", @@ -3981,7 +3981,7 @@ "label": "options", "description": [], "signature": [ - "{ fields?: string[] | undefined; }" + "{ fields?: string[] | undefined; withPackagePolicies?: boolean | undefined; ignoreMissing?: boolean | undefined; }" ], "path": "x-pack/plugins/fleet/server/services/agent_policy.ts", "deprecated": false @@ -5312,7 +5312,7 @@ "signature": [ "(soClient: ", "SavedObjectsClientContract", - ", ids: string[]) => Promise<", + ", ids: string[], options?: { ignoreMissing?: boolean | undefined; } | undefined) => Promise<", { "pluginId": "fleet", "scope": "common", @@ -5352,6 +5352,31 @@ "path": "x-pack/plugins/fleet/server/services/package_policy.ts", "deprecated": false, "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.getByIDs.$3", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.getByIDs.$3.ignoreMissing", + "type": "CompoundType", + "tags": [], + "label": "ignoreMissing", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + } + ] } ], "returnComment": [] @@ -9768,7 +9793,7 @@ "label": "install_source", "description": [], "signature": [ - "\"upload\" | \"registry\" | \"bundled\"" + "\"registry\" | \"upload\" | \"bundled\"" ], "path": "x-pack/plugins/fleet/common/types/models/epm.ts", "deprecated": false @@ -9918,7 +9943,7 @@ "label": "installSource", "description": [], "signature": [ - "\"upload\" | \"registry\" | \"bundled\"" + "\"registry\" | \"upload\" | \"bundled\"" ], "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", "deprecated": false @@ -13933,7 +13958,7 @@ "label": "RegistrySearchResult", "description": [], "signature": [ - "{ type?: \"integration\" | undefined; path: string; name: string; version: string; title: string; download: string; description: string; icons?: (", + "{ type?: \"integration\" | undefined; path: string; download: string; title: string; description: string; icons?: (", { "pluginId": "fleet", "scope": "common", @@ -13957,7 +13982,7 @@ "section": "def-common.PackageSpecCategory", "text": "PackageSpecCategory" }, - " | undefined)[] | undefined; internal?: boolean | undefined; release?: \"experimental\" | \"beta\" | \"ga\" | undefined; policy_templates?: ", + " | undefined)[] | undefined; name: string; version: string; internal?: boolean | undefined; release?: \"experimental\" | \"beta\" | \"ga\" | undefined; policy_templates?: ", { "pluginId": "fleet", "scope": "common", @@ -14292,6 +14317,16 @@ "path": "x-pack/plugins/fleet/common/constants/routes.ts", "deprecated": false }, + { + "parentPluginId": "fleet", + "id": "def-common.AGENT_POLICY_API_ROUTES.BULK_GET_PATTERN", + "type": "string", + "tags": [], + "label": "BULK_GET_PATTERN", + "description": [], + "path": "x-pack/plugins/fleet/common/constants/routes.ts", + "deprecated": false + }, { "parentPluginId": "fleet", "id": "def-common.AGENT_POLICY_API_ROUTES.INFO_PATTERN", @@ -15641,6 +15676,16 @@ "path": "x-pack/plugins/fleet/common/constants/routes.ts", "deprecated": false }, + { + "parentPluginId": "fleet", + "id": "def-common.PACKAGE_POLICY_API_ROUTES.BULK_GET_PATTERN", + "type": "string", + "tags": [], + "label": "BULK_GET_PATTERN", + "description": [], + "path": "x-pack/plugins/fleet/common/constants/routes.ts", + "deprecated": false + }, { "parentPluginId": "fleet", "id": "def-common.PACKAGE_POLICY_API_ROUTES.INFO_PATTERN", diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index ce79d447434cd..0f0f20355f8c9 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fleet title: "fleet" image: https://source.unsplash.com/400x175/?github description: API docs for the fleet plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Fleet](https://github.com/orgs/elastic/teams/fleet) for questions regar | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 957 | 3 | 862 | 9 | +| 961 | 3 | 866 | 9 | ## Client diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index 574e03339c6bb..e1d92210fda2f 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/globalSearch title: "globalSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the globalSearch plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] --- import globalSearchObj from './global_search.devdocs.json'; diff --git a/api_docs/home.devdocs.json b/api_docs/home.devdocs.json index 14a039d123e3d..907464f15b49b 100644 --- a/api_docs/home.devdocs.json +++ b/api_docs/home.devdocs.json @@ -375,7 +375,7 @@ "{@link FeatureCatalogueCategory} to display this feature in." ], "signature": [ - "\"other\" | \"data\" | \"admin\"" + "\"data\" | \"other\" | \"admin\"" ], "path": "src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.ts", "deprecated": false @@ -708,7 +708,7 @@ "label": "FeatureCatalogueCategory", "description": [], "signature": [ - "\"other\" | \"data\" | \"admin\"" + "\"data\" | \"other\" | \"admin\"" ], "path": "src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.ts", "deprecated": false, @@ -1598,7 +1598,7 @@ "label": "InstructionSetSchema", "description": [], "signature": [ - "{ readonly title?: string | undefined; readonly callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; readonly statusCheck?: Readonly<{ error?: string | undefined; title?: string | undefined; success?: string | undefined; text?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; readonly instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }" + "{ readonly title?: string | undefined; readonly callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; readonly statusCheck?: Readonly<{ error?: string | undefined; success?: string | undefined; text?: string | undefined; title?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; readonly instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }" ], "path": "src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts", "deprecated": false, @@ -1612,7 +1612,7 @@ "label": "InstructionsSchema", "description": [], "signature": [ - "{ readonly params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; readonly instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; title?: string | undefined; success?: string | undefined; text?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }" + "{ readonly params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; label: string; id: string; }>[] | undefined; readonly instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; success?: string | undefined; text?: string | undefined; title?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }" ], "path": "src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts", "deprecated": false, @@ -1628,7 +1628,7 @@ "signature": [ "{ getSampleDatasets: () => ", "Writable", - "[]; previewImagePath: string; overviewDashboard: string; defaultIndex: string; dataIndices: Readonly<{} & { id: string; fields: Record; timeFields: string[]; dataPath: string; currentTimeMarker: string; preserveDayOfWeekTimeOfDay: boolean; }>[]; }>>[]; addSavedObjectsToSampleDataset: (id: string, savedObjects: ", + "[]; previewImagePath: string; overviewDashboard: string; defaultIndex: string; dataIndices: Readonly<{} & { id: string; fields: Record; timeFields: string[]; dataPath: string; currentTimeMarker: string; preserveDayOfWeekTimeOfDay: boolean; }>[]; }>>[]; addSavedObjectsToSampleDataset: (id: string, savedObjects: ", "SavedObject", "[]) => void; addAppLinksToSampleDataset: (id: string, appLinks: ", { @@ -1662,7 +1662,7 @@ "signature": [ "() => ", "Writable", - "[]; previewImagePath: string; overviewDashboard: string; defaultIndex: string; dataIndices: Readonly<{} & { id: string; fields: Record; timeFields: string[]; dataPath: string; currentTimeMarker: string; preserveDayOfWeekTimeOfDay: boolean; }>[]; }>>" + "[]; previewImagePath: string; overviewDashboard: string; defaultIndex: string; dataIndices: Readonly<{} & { id: string; fields: Record; timeFields: string[]; dataPath: string; currentTimeMarker: string; preserveDayOfWeekTimeOfDay: boolean; }>[]; }>>" ], "path": "src/plugins/home/server/services/sample_data/lib/sample_dataset_registry_types.ts", "deprecated": false, @@ -1716,7 +1716,7 @@ "section": "def-server.TutorialContext", "text": "TutorialContext" }, - ") => Readonly<{ isBeta?: boolean | undefined; savedObjects?: any[] | undefined; euiIconType?: string | undefined; previewImagePath?: string | undefined; moduleName?: string | undefined; completionTimeMinutes?: number | undefined; elasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; title?: string | undefined; success?: string | undefined; text?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; onPremElasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; title?: string | undefined; success?: string | undefined; text?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; artifacts?: Readonly<{ application?: Readonly<{} & { path: string; label: string; }> | undefined; exportedFields?: Readonly<{} & { documentationUrl: string; }> | undefined; } & { dashboards: Readonly<{ linkLabel?: string | undefined; } & { id: string; isOverview: boolean; }>[]; }> | undefined; savedObjectsInstallMsg?: string | undefined; customStatusCheckName?: string | undefined; integrationBrowserCategories?: string[] | undefined; eprPackageOverlap?: string | undefined; } & { id: string; name: string; category: \"other\" | \"security\" | \"metrics\" | \"logging\"; shortDescription: string; longDescription: string; onPrem: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; title?: string | undefined; success?: string | undefined; text?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }>; }>" + ") => Readonly<{ isBeta?: boolean | undefined; savedObjects?: any[] | undefined; euiIconType?: string | undefined; previewImagePath?: string | undefined; moduleName?: string | undefined; completionTimeMinutes?: number | undefined; elasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; label: string; id: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; success?: string | undefined; text?: string | undefined; title?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; onPremElasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; label: string; id: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; success?: string | undefined; text?: string | undefined; title?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; artifacts?: Readonly<{ application?: Readonly<{} & { path: string; label: string; }> | undefined; exportedFields?: Readonly<{} & { documentationUrl: string; }> | undefined; } & { dashboards: Readonly<{ linkLabel?: string | undefined; } & { id: string; isOverview: boolean; }>[]; }> | undefined; savedObjectsInstallMsg?: string | undefined; customStatusCheckName?: string | undefined; integrationBrowserCategories?: string[] | undefined; eprPackageOverlap?: string | undefined; } & { id: string; name: string; category: \"other\" | \"security\" | \"metrics\" | \"logging\"; shortDescription: string; longDescription: string; onPrem: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; label: string; id: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; success?: string | undefined; text?: string | undefined; title?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }>; }>" ], "path": "src/plugins/home/server/services/tutorials/lib/tutorials_registry_types.ts", "deprecated": false, @@ -1752,7 +1752,7 @@ "label": "TutorialSchema", "description": [], "signature": [ - "{ readonly isBeta?: boolean | undefined; readonly savedObjects?: any[] | undefined; readonly euiIconType?: string | undefined; readonly previewImagePath?: string | undefined; readonly moduleName?: string | undefined; readonly completionTimeMinutes?: number | undefined; readonly elasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; title?: string | undefined; success?: string | undefined; text?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; readonly onPremElasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; title?: string | undefined; success?: string | undefined; text?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; readonly artifacts?: Readonly<{ application?: Readonly<{} & { path: string; label: string; }> | undefined; exportedFields?: Readonly<{} & { documentationUrl: string; }> | undefined; } & { dashboards: Readonly<{ linkLabel?: string | undefined; } & { id: string; isOverview: boolean; }>[]; }> | undefined; readonly savedObjectsInstallMsg?: string | undefined; readonly customStatusCheckName?: string | undefined; readonly integrationBrowserCategories?: string[] | undefined; readonly eprPackageOverlap?: string | undefined; readonly id: string; readonly name: string; readonly category: \"other\" | \"security\" | \"metrics\" | \"logging\"; readonly shortDescription: string; readonly longDescription: string; readonly onPrem: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; title?: string | undefined; success?: string | undefined; text?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }>; }" + "{ readonly isBeta?: boolean | undefined; readonly savedObjects?: any[] | undefined; readonly euiIconType?: string | undefined; readonly previewImagePath?: string | undefined; readonly moduleName?: string | undefined; readonly completionTimeMinutes?: number | undefined; readonly elasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; label: string; id: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; success?: string | undefined; text?: string | undefined; title?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; readonly onPremElasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; label: string; id: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; success?: string | undefined; text?: string | undefined; title?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; readonly artifacts?: Readonly<{ application?: Readonly<{} & { path: string; label: string; }> | undefined; exportedFields?: Readonly<{} & { documentationUrl: string; }> | undefined; } & { dashboards: Readonly<{ linkLabel?: string | undefined; } & { id: string; isOverview: boolean; }>[]; }> | undefined; readonly savedObjectsInstallMsg?: string | undefined; readonly customStatusCheckName?: string | undefined; readonly integrationBrowserCategories?: string[] | undefined; readonly eprPackageOverlap?: string | undefined; readonly id: string; readonly name: string; readonly category: \"other\" | \"security\" | \"metrics\" | \"logging\"; readonly shortDescription: string; readonly longDescription: string; readonly onPrem: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; label: string; id: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ message?: string | undefined; iconType?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ error?: string | undefined; success?: string | undefined; text?: string | undefined; title?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }>; }" ], "path": "src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts", "deprecated": false, @@ -2021,7 +2021,7 @@ "signature": [ "{ getSampleDatasets: () => ", "Writable", - "[]; previewImagePath: string; overviewDashboard: string; defaultIndex: string; dataIndices: Readonly<{} & { id: string; fields: Record; timeFields: string[]; dataPath: string; currentTimeMarker: string; preserveDayOfWeekTimeOfDay: boolean; }>[]; }>>[]; addSavedObjectsToSampleDataset: (id: string, savedObjects: ", + "[]; previewImagePath: string; overviewDashboard: string; defaultIndex: string; dataIndices: Readonly<{} & { id: string; fields: Record; timeFields: string[]; dataPath: string; currentTimeMarker: string; preserveDayOfWeekTimeOfDay: boolean; }>[]; }>>[]; addSavedObjectsToSampleDataset: (id: string, savedObjects: ", "SavedObject", "[]) => void; addAppLinksToSampleDataset: (id: string, appLinks: ", { diff --git a/api_docs/home.mdx b/api_docs/home.mdx index de6920e26525e..2516ace023b1d 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/home title: "home" image: https://source.unsplash.com/400x175/?github description: API docs for the home plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] --- import homeObj from './home.devdocs.json'; diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index bd2c716c6ed96..265130a5a3e40 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexLifecycleManagement title: "indexLifecycleManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexLifecycleManagement plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] --- import indexLifecycleManagementObj from './index_lifecycle_management.devdocs.json'; diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index 373b2c863c103..50791c3d1b735 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexManagement title: "indexManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexManagement plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] --- import indexManagementObj from './index_management.devdocs.json'; diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 542aaa6c4c0e5..4bfe04ae84795 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/infra title: "infra" image: https://source.unsplash.com/400x175/?github description: API docs for the infra plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] --- import infraObj from './infra.devdocs.json'; diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 03d099fc49bb4..fee794d32b8c7 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inspector title: "inspector" image: https://source.unsplash.com/400x175/?github description: API docs for the inspector plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 499ce50776be3..5c92316cd80c2 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/interactiveSetup title: "interactiveSetup" image: https://source.unsplash.com/400x175/?github description: API docs for the interactiveSetup plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index 55ceabe59245f..bca38d0a78201 100644 --- a/api_docs/kbn_ace.mdx +++ b/api_docs/kbn_ace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ace title: "@kbn/ace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ace plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] --- import kbnAceObj from './kbn_ace.devdocs.json'; diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index 771c279ecfd68..a7bb99de9d298 100644 --- a/api_docs/kbn_aiops_components.mdx +++ b/api_docs/kbn_aiops_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-components title: "@kbn/aiops-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-components plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] --- import kbnAiopsComponentsObj from './kbn_aiops_components.devdocs.json'; diff --git a/api_docs/kbn_aiops_utils.mdx b/api_docs/kbn_aiops_utils.mdx index 8c97463b841b7..fd47ee26950e4 100644 --- a/api_docs/kbn_aiops_utils.mdx +++ b/api_docs/kbn_aiops_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-utils title: "@kbn/aiops-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-utils'] --- import kbnAiopsUtilsObj from './kbn_aiops_utils.devdocs.json'; diff --git a/api_docs/kbn_alerts.mdx b/api_docs/kbn_alerts.mdx index f426944e9355a..4d736109e9f6a 100644 --- a/api_docs/kbn_alerts.mdx +++ b/api_docs/kbn_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts title: "@kbn/alerts" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts'] --- import kbnAlertsObj from './kbn_alerts.devdocs.json'; diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index 31c3ddb6fa97c..27f3a4bc41abd 100644 --- a/api_docs/kbn_analytics.mdx +++ b/api_docs/kbn_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics title: "@kbn/analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] --- import kbnAnalyticsObj from './kbn_analytics.devdocs.json'; diff --git a/api_docs/kbn_analytics_client.devdocs.json b/api_docs/kbn_analytics_client.devdocs.json index 25b6744b3f9bc..4bf4b8891da73 100644 --- a/api_docs/kbn_analytics_client.devdocs.json +++ b/api_docs/kbn_analytics_client.devdocs.json @@ -1760,7 +1760,7 @@ "Types matching string values" ], "signature": [ - "\"date\" | \"text\" | \"keyword\"" + "\"date\" | \"keyword\" | \"text\"" ], "path": "packages/analytics/client/src/schema/types.ts", "deprecated": false, @@ -1776,7 +1776,7 @@ "\nPossible type values in the schema" ], "signature": [ - "\"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"short\" | \"float\" | \"integer\" | \"byte\"" + "\"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"short\" | \"float\" | \"integer\" | \"byte\"" ], "path": "packages/analytics/client/src/schema/types.ts", "deprecated": false, diff --git a/api_docs/kbn_analytics_client.mdx b/api_docs/kbn_analytics_client.mdx index bdfecf9f20727..a8ba75f884b89 100644 --- a/api_docs/kbn_analytics_client.mdx +++ b/api_docs/kbn_analytics_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-client title: "@kbn/analytics-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-client plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-client'] --- import kbnAnalyticsClientObj from './kbn_analytics_client.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx index ba52437bf4586..11cd1fdc20f02 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-browser title: "@kbn/analytics-shippers-elastic-v3-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-browser'] --- import kbnAnalyticsShippersElasticV3BrowserObj from './kbn_analytics_shippers_elastic_v3_browser.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx index 71b9bcbe2f338..7e0becc951edf 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-common title: "@kbn/analytics-shippers-elastic-v3-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-common plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-common'] --- import kbnAnalyticsShippersElasticV3CommonObj from './kbn_analytics_shippers_elastic_v3_common.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx index d9f9933d6d479..24c9fc0fddc8c 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-server title: "@kbn/analytics-shippers-elastic-v3-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-server'] --- import kbnAnalyticsShippersElasticV3ServerObj from './kbn_analytics_shippers_elastic_v3_server.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_fullstory.mdx b/api_docs/kbn_analytics_shippers_fullstory.mdx index 3f9eac25cc145..9bc9fe8fb51ff 100644 --- a/api_docs/kbn_analytics_shippers_fullstory.mdx +++ b/api_docs/kbn_analytics_shippers_fullstory.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-fullstory title: "@kbn/analytics-shippers-fullstory" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-fullstory plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-fullstory'] --- import kbnAnalyticsShippersFullstoryObj from './kbn_analytics_shippers_fullstory.devdocs.json'; diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index 01686d7494478..398fa3a6741ce 100644 --- a/api_docs/kbn_apm_config_loader.mdx +++ b/api_docs/kbn_apm_config_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-config-loader title: "@kbn/apm-config-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-config-loader plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] --- import kbnApmConfigLoaderObj from './kbn_apm_config_loader.devdocs.json'; diff --git a/api_docs/elastic_apm_synthtrace.devdocs.json b/api_docs/kbn_apm_synthtrace.devdocs.json similarity index 75% rename from api_docs/elastic_apm_synthtrace.devdocs.json rename to api_docs/kbn_apm_synthtrace.devdocs.json index 7795015f81289..4994a6ae917e2 100644 --- a/api_docs/elastic_apm_synthtrace.devdocs.json +++ b/api_docs/kbn_apm_synthtrace.devdocs.json @@ -1,5 +1,5 @@ { - "id": "@elastic/apm-synthtrace", + "id": "@kbn/apm-synthtrace", "client": { "classes": [], "functions": [], @@ -11,17 +11,17 @@ "server": { "classes": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient", "type": "Class", "tags": [], "label": "ApmSynthtraceEsClient", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.Unnamed", "type": "Function", "tags": [], @@ -30,11 +30,11 @@ "signature": [ "any" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.Unnamed.$1", "type": "Object", "tags": [], @@ -43,12 +43,12 @@ "signature": [ "default" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": true }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.Unnamed.$2", "type": "Object", "tags": [], @@ -57,12 +57,12 @@ "signature": [ "{ perf: (name: string, cb: () => T) => T; debug: (...args: any[]) => void; info: (...args: any[]) => void; error: (...args: any[]) => void; }" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": true }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.Unnamed.$3", "type": "Object", "tags": [], @@ -72,7 +72,7 @@ "ApmSynthtraceEsClientOptions", " | undefined" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": false } @@ -80,7 +80,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.runningVersion", "type": "Function", "tags": [], @@ -89,13 +89,13 @@ "signature": [ "() => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.clean", "type": "Function", "tags": [], @@ -104,11 +104,11 @@ "signature": [ "(dataStreams?: string[] | undefined) => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.clean.$1", "type": "Array", "tags": [], @@ -117,7 +117,7 @@ "signature": [ "string[] | undefined" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": false } @@ -125,7 +125,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.updateComponentTemplates", "type": "Function", "tags": [], @@ -134,11 +134,11 @@ "signature": [ "(numberOfPrimaryShards: number) => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.updateComponentTemplates.$1", "type": "number", "tags": [], @@ -147,7 +147,7 @@ "signature": [ "number" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": true } @@ -155,7 +155,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.registerGcpRepository", "type": "Function", "tags": [], @@ -164,11 +164,11 @@ "signature": [ "(connectionString: string) => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.registerGcpRepository.$1", "type": "string", "tags": [], @@ -177,7 +177,7 @@ "signature": [ "string" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": true } @@ -185,7 +185,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.refresh", "type": "Function", "tags": [], @@ -196,13 +196,13 @@ "ShardsOperationResponseBase", ">" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.index", "type": "Function", "tags": [], @@ -211,17 +211,17 @@ "signature": [ "(events: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, " | ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, @@ -229,9 +229,9 @@ "StreamToBulkOptions", "<", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, @@ -239,19 +239,19 @@ "StreamProcessor", "<", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "> | undefined) => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.index.$1", "type": "CompoundType", "tags": [], @@ -259,28 +259,28 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, " | ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": true }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.index.$2", "type": "Object", "tags": [], @@ -290,20 +290,20 @@ "StreamToBulkOptions", "<", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "> | undefined" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.index.$3", "type": "Object", "tags": [], @@ -313,15 +313,15 @@ "StreamProcessor", "<", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "> | undefined" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": false } @@ -329,7 +329,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.createDataStream", "type": "Function", "tags": [], @@ -340,19 +340,19 @@ "StreamAggregator", "<", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, ">) => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.createDataStream.$1", "type": "Object", "tags": [], @@ -362,15 +362,15 @@ "StreamAggregator", "<", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, ">" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": true } @@ -381,7 +381,7 @@ "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable", "type": "Class", "tags": [], @@ -389,27 +389,27 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityArrayIterable", "text": "EntityArrayIterable" }, " implements ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, "" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.Unnamed", "type": "Function", "tags": [], @@ -418,11 +418,11 @@ "signature": [ "any" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.Unnamed.$1", "type": "Array", "tags": [], @@ -431,7 +431,7 @@ "signature": [ "TFields[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "isRequired": true } @@ -439,7 +439,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.order", "type": "Function", "tags": [], @@ -448,13 +448,13 @@ "signature": [ "() => \"asc\" | \"desc\"" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.ratePerMinute", "type": "Function", "tags": [], @@ -463,13 +463,13 @@ "signature": [ "() => number" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.Symbol.asyncIterator", "type": "Function", "tags": [], @@ -478,13 +478,13 @@ "signature": [ "() => AsyncIterator" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.Symbol.iterator", "type": "Function", "tags": [], @@ -493,13 +493,13 @@ "signature": [ "() => Iterator" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.merge", "type": "Function", "tags": [], @@ -508,9 +508,9 @@ "signature": [ "(...iterables: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, @@ -518,11 +518,11 @@ "EntityStreams", "" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.merge.$1", "type": "Array", "tags": [], @@ -530,15 +530,15 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "isRequired": true } @@ -546,7 +546,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.toArray", "type": "Function", "tags": [], @@ -555,7 +555,7 @@ "signature": [ "() => TFields[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] @@ -566,7 +566,7 @@ ], "functions": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.cleanWriteTargets", "type": "Function", "tags": [], @@ -577,21 +577,21 @@ "default", "; logger: { perf: (name: string, cb: () => T) => T; debug: (...args: any[]) => void; info: (...args: any[]) => void; error: (...args: any[]) => void; }; }) => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.cleanWriteTargets.$1", "type": "Object", "tags": [], "label": "{\n targets,\n client,\n logger,\n}", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.cleanWriteTargets.$1.targets", "type": "Array", "tags": [], @@ -600,11 +600,11 @@ "signature": [ "string[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts", "deprecated": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.cleanWriteTargets.$1.client", "type": "Object", "tags": [], @@ -613,11 +613,11 @@ "signature": [ "default" ], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts", "deprecated": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.cleanWriteTargets.$1.logger", "type": "Object", "tags": [], @@ -626,7 +626,7 @@ "signature": [ "{ perf: (name: string, cb: () => T) => T; debug: (...args: any[]) => void; info: (...args: any[]) => void; error: (...args: any[]) => void; }" ], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts", "deprecated": false } ] @@ -636,7 +636,7 @@ "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.createLogger", "type": "Function", "tags": [], @@ -645,19 +645,19 @@ "signature": [ "(logLevel: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.LogLevel", "text": "LogLevel" }, ") => { perf: (name: string, cb: () => T) => T; debug: (...args: any[]) => void; info: (...args: any[]) => void; error: (...args: any[]) => void; }" ], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/create_logger.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/create_logger.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.createLogger.$1", "type": "Enum", "tags": [], @@ -665,14 +665,14 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.LogLevel", "text": "LogLevel" } ], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/create_logger.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/create_logger.ts", "deprecated": false, "isRequired": true } @@ -681,7 +681,7 @@ "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.observer", "type": "Function", "tags": [], @@ -691,14 +691,14 @@ "() => ", "Observer" ], - "path": "packages/elastic-apm-synthtrace/src/lib/agent_config/observer.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/agent_config/observer.ts", "deprecated": false, "children": [], "returnComment": [], "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.timerange", "type": "Function", "tags": [], @@ -708,11 +708,11 @@ "(from: number | Date, to: number | Date) => ", "Timerange" ], - "path": "packages/elastic-apm-synthtrace/src/lib/timerange.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/timerange.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.timerange.$1", "type": "CompoundType", "tags": [], @@ -721,12 +721,12 @@ "signature": [ "number | Date" ], - "path": "packages/elastic-apm-synthtrace/src/lib/timerange.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/timerange.ts", "deprecated": false, "isRequired": true }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.timerange.$2", "type": "CompoundType", "tags": [], @@ -735,7 +735,7 @@ "signature": [ "number | Date" ], - "path": "packages/elastic-apm-synthtrace/src/lib/timerange.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/timerange.ts", "deprecated": false, "isRequired": true } @@ -746,30 +746,30 @@ ], "interfaces": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmException", "type": "Interface", "tags": [], "label": "ApmException", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/apm_fields.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmException.message", "type": "string", "tags": [], "label": "message", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/apm_fields.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts", "deprecated": false } ], "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityIterable", "type": "Interface", "tags": [], @@ -777,19 +777,19 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, " extends Iterable,AsyncIterable" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityIterable.order", "type": "Function", "tags": [], @@ -798,13 +798,13 @@ "signature": [ "() => \"asc\" | \"desc\"" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityIterable.ratePerMinute", "type": "Function", "tags": [], @@ -813,13 +813,13 @@ "signature": [ "() => number" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityIterable.toArray", "type": "Function", "tags": [], @@ -828,21 +828,21 @@ "signature": [ "() => ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityIterable.merge", "type": "Function", "tags": [], @@ -851,9 +851,9 @@ "signature": [ "(...iterables: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, @@ -861,11 +861,11 @@ "EntityStreams", "" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityIterable.merge.$1", "type": "Array", "tags": [], @@ -873,15 +873,15 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "isRequired": true } @@ -892,17 +892,17 @@ "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.Fields", "type": "Interface", "tags": [], "label": "Fields", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/entity.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.Fields.timestamp", "type": "number", "tags": [], @@ -911,7 +911,7 @@ "signature": [ "number | undefined" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity.ts", "deprecated": false } ], @@ -920,20 +920,20 @@ ], "enums": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.LogLevel", "type": "Enum", "tags": [], "label": "LogLevel", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/create_logger.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/create_logger.ts", "deprecated": false, "initialIsOpen": false } ], "misc": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmFields", "type": "Type", "tags": [], @@ -941,17 +941,17 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.Fields", "text": "Fields" }, " & Partial<{ 'timestamp.us'?: number | undefined; 'agent.name': string; 'agent.version': string; 'container.id': string; 'ecs.version': string; 'event.outcome': string; 'event.ingested': number; 'error.id': string; 'error.exception': ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmException", "text": "ApmException" }, @@ -959,24 +959,24 @@ "Observer", "; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.version': string; 'service.environment': string; 'service.node.name': string; 'service.runtime.name': string; 'service.runtime.version': string; 'service.framework.name': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.name': string; 'span.destination.service.resource': string; 'span.destination.service.type': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; 'span.links': { trace: { id: string; }; span: { id: string; }; }[]; 'cloud.provider': string; 'cloud.project.name': string; 'cloud.service.name': string; 'cloud.availability_zone': string; 'cloud.machine.type': string; 'cloud.region': string; 'host.os.platform': string; 'faas.id': string; 'faas.coldstart': boolean; 'faas.execution': string; 'faas.trigger.type': string; 'faas.trigger.request_id': string; }> & Partial<{ 'system.process.memory.size': number; 'system.memory.actual.free': number; 'system.memory.total': number; 'system.cpu.total.norm.pct': number; 'system.process.memory.rss.bytes': number; 'system.process.cpu.total.norm.pct': number; 'jvm.memory.heap.used': number; 'jvm.memory.non_heap.used': number; 'jvm.thread.count': number; }>" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/apm_fields.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts", "deprecated": false, "initialIsOpen": false } ], "objects": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm", "type": "Object", "tags": [], "label": "apm", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.service", "type": "Function", "tags": [], @@ -986,44 +986,44 @@ "(name: string, environment: string, agentName: string) => ", "Service" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.service.$1", "type": "string", "tags": [], "label": "name", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/service.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/service.ts", "deprecated": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.service.$2", "type": "string", "tags": [], "label": "environment", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/service.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/service.ts", "deprecated": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.service.$3", "type": "string", "tags": [], "label": "agentName", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/service.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/service.ts", "deprecated": false } ] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.browser", "type": "Function", "tags": [], @@ -1033,32 +1033,32 @@ "(serviceName: string, production: string, userAgent: Partial<{ 'user_agent.original': string; 'user_agent.os.name': string; 'user_agent.name': string; 'user_agent.device.name': string; 'user_agent.version': number; }>) => ", "Browser" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.browser.$1", "type": "string", "tags": [], "label": "serviceName", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/browser.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/browser.ts", "deprecated": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.browser.$2", "type": "string", "tags": [], "label": "production", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/browser.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/browser.ts", "deprecated": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.browser.$3", "type": "Object", "tags": [], @@ -1067,13 +1067,13 @@ "signature": [ "{ 'user_agent.original'?: string | undefined; 'user_agent.os.name'?: string | undefined; 'user_agent.name'?: string | undefined; 'user_agent.device.name'?: string | undefined; 'user_agent.version'?: number | undefined; }" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/browser.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/browser.ts", "deprecated": false } ] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getTransactionMetrics", "type": "Function", "tags": [], @@ -1082,17 +1082,17 @@ "signature": [ "(events: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]) => { 'metricset.name': string; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; _doc_count: number; '@timestamp'?: number | undefined; 'timestamp.us'?: number | undefined; 'agent.name'?: string | undefined; 'agent.version'?: string | undefined; 'container.id'?: string | undefined; 'ecs.version'?: string | undefined; 'event.outcome'?: string | undefined; 'event.ingested'?: number | undefined; 'error.id'?: string | undefined; 'error.exception'?: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmException", "text": "ApmException" }, @@ -1100,12 +1100,12 @@ "Observer", " | undefined; 'parent.id'?: string | undefined; 'processor.event'?: string | undefined; 'processor.name'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.name'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.id'?: string | undefined; 'transaction.duration.us'?: number | undefined; 'transaction.sampled'?: true | undefined; 'service.name'?: string | undefined; 'service.version'?: string | undefined; 'service.environment'?: string | undefined; 'service.node.name'?: string | undefined; 'service.runtime.name'?: string | undefined; 'service.runtime.version'?: string | undefined; 'service.framework.name'?: string | undefined; 'span.id'?: string | undefined; 'span.name'?: string | undefined; 'span.type'?: string | undefined; 'span.subtype'?: string | undefined; 'span.duration.us'?: number | undefined; 'span.destination.service.name'?: string | undefined; 'span.destination.service.resource'?: string | undefined; 'span.destination.service.type'?: string | undefined; 'span.destination.service.response_time.sum.us'?: number | undefined; 'span.destination.service.response_time.count'?: number | undefined; 'span.self_time.count'?: number | undefined; 'span.self_time.sum.us'?: number | undefined; 'span.links'?: { trace: { id: string; }; span: { id: string; }; }[] | undefined; 'cloud.provider'?: string | undefined; 'cloud.project.name'?: string | undefined; 'cloud.service.name'?: string | undefined; 'cloud.availability_zone'?: string | undefined; 'cloud.machine.type'?: string | undefined; 'cloud.region'?: string | undefined; 'host.os.platform'?: string | undefined; 'faas.id'?: string | undefined; 'faas.coldstart'?: boolean | undefined; 'faas.execution'?: string | undefined; 'faas.trigger.type'?: string | undefined; 'faas.trigger.request_id'?: string | undefined; 'system.process.memory.size'?: number | undefined; 'system.memory.actual.free'?: number | undefined; 'system.memory.total'?: number | undefined; 'system.cpu.total.norm.pct'?: number | undefined; 'system.process.memory.rss.bytes'?: number | undefined; 'system.process.cpu.total.norm.pct'?: number | undefined; 'jvm.memory.heap.used'?: number | undefined; 'jvm.memory.non_heap.used'?: number | undefined; 'jvm.thread.count'?: number | undefined; }[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getTransactionMetrics.$1", "type": "Array", "tags": [], @@ -1113,21 +1113,21 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/processors/get_transaction_metrics.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/processors/get_transaction_metrics.ts", "deprecated": false } ] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getSpanDestinationMetrics", "type": "Function", "tags": [], @@ -1136,17 +1136,17 @@ "signature": [ "(events: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]) => { \"metricset.name\": string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; '@timestamp'?: number | undefined; 'timestamp.us'?: number | undefined; 'agent.name'?: string | undefined; 'agent.version'?: string | undefined; 'container.id'?: string | undefined; 'ecs.version'?: string | undefined; 'event.outcome'?: string | undefined; 'event.ingested'?: number | undefined; 'error.id'?: string | undefined; 'error.exception'?: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmException", "text": "ApmException" }, @@ -1154,12 +1154,12 @@ "Observer", " | undefined; 'parent.id'?: string | undefined; 'processor.event'?: string | undefined; 'processor.name'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.name'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.id'?: string | undefined; 'transaction.duration.us'?: number | undefined; 'transaction.duration.histogram'?: { values: number[]; counts: number[]; } | undefined; 'transaction.sampled'?: true | undefined; 'service.name'?: string | undefined; 'service.version'?: string | undefined; 'service.environment'?: string | undefined; 'service.node.name'?: string | undefined; 'service.runtime.name'?: string | undefined; 'service.runtime.version'?: string | undefined; 'service.framework.name'?: string | undefined; 'span.id'?: string | undefined; 'span.name'?: string | undefined; 'span.type'?: string | undefined; 'span.subtype'?: string | undefined; 'span.duration.us'?: number | undefined; 'span.destination.service.name'?: string | undefined; 'span.destination.service.resource'?: string | undefined; 'span.destination.service.type'?: string | undefined; 'span.self_time.count'?: number | undefined; 'span.self_time.sum.us'?: number | undefined; 'span.links'?: { trace: { id: string; }; span: { id: string; }; }[] | undefined; 'cloud.provider'?: string | undefined; 'cloud.project.name'?: string | undefined; 'cloud.service.name'?: string | undefined; 'cloud.availability_zone'?: string | undefined; 'cloud.machine.type'?: string | undefined; 'cloud.region'?: string | undefined; 'host.os.platform'?: string | undefined; 'faas.id'?: string | undefined; 'faas.coldstart'?: boolean | undefined; 'faas.execution'?: string | undefined; 'faas.trigger.type'?: string | undefined; 'faas.trigger.request_id'?: string | undefined; 'system.process.memory.size'?: number | undefined; 'system.memory.actual.free'?: number | undefined; 'system.memory.total'?: number | undefined; 'system.cpu.total.norm.pct'?: number | undefined; 'system.process.memory.rss.bytes'?: number | undefined; 'system.process.cpu.total.norm.pct'?: number | undefined; 'jvm.memory.heap.used'?: number | undefined; 'jvm.memory.non_heap.used'?: number | undefined; 'jvm.thread.count'?: number | undefined; }[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getSpanDestinationMetrics.$1", "type": "Array", "tags": [], @@ -1167,21 +1167,21 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/processors/get_span_destination_metrics.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/processors/get_span_destination_metrics.ts", "deprecated": false } ] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getChromeUserAgentDefaults", "type": "Function", "tags": [], @@ -1190,13 +1190,13 @@ "signature": [ "() => Partial<{ 'user_agent.original': string; 'user_agent.os.name': string; 'user_agent.name': string; 'user_agent.device.name': string; 'user_agent.version': number; }>" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getBreakdownMetrics", "type": "Function", "tags": [], @@ -1205,28 +1205,28 @@ "signature": [ "(events: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]) => ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getBreakdownMetrics.$1", "type": "Array", "tags": [], @@ -1234,21 +1234,21 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/processors/get_breakdown_metrics.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/processors/get_breakdown_metrics.ts", "deprecated": false } ] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getApmWriteTargets", "type": "Function", "tags": [], @@ -1261,12 +1261,12 @@ "ApmElasticsearchOutputWriteTargets", ">" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getApmWriteTargets.$1", "type": "Object", "tags": [], @@ -1277,13 +1277,13 @@ "default", "; forceLegacyIndices?: boolean | undefined; }" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/utils/get_apm_write_targets.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/utils/get_apm_write_targets.ts", "deprecated": false } ] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.ApmSynthtraceEsClient", "type": "Object", "tags": [], @@ -1292,31 +1292,31 @@ "signature": [ "typeof ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmSynthtraceEsClient", "text": "ApmSynthtraceEsClient" } ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false } ], "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.stackMonitoring", "type": "Object", "tags": [], "label": "stackMonitoring", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/stack_monitoring/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/stack_monitoring/index.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.stackMonitoring.cluster", "type": "Function", "tags": [], @@ -1326,18 +1326,18 @@ "(name: string) => ", "Cluster" ], - "path": "packages/elastic-apm-synthtrace/src/lib/stack_monitoring/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/stack_monitoring/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.stackMonitoring.cluster.$1", "type": "string", "tags": [], "label": "name", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/stack_monitoring/cluster.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/stack_monitoring/cluster.ts", "deprecated": false } ] diff --git a/api_docs/kbn_apm_synthtrace.mdx b/api_docs/kbn_apm_synthtrace.mdx new file mode 100644 index 0000000000000..48c281f3209f0 --- /dev/null +++ b/api_docs/kbn_apm_synthtrace.mdx @@ -0,0 +1,45 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnApmSynthtracePluginApi +slug: /kibana-dev-docs/api/kbn-apm-synthtrace +title: "@kbn/apm-synthtrace" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/apm-synthtrace plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace'] +--- +import kbnApmSynthtraceObj from './kbn_apm_synthtrace.devdocs.json'; + +Elastic APM trace data generator + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 74 | 0 | 74 | 11 | + +## Server + +### Objects + + +### Functions + + +### Classes + + +### Interfaces + + +### Enums + + +### Consts, variables and types + + diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index 0e889a78dd325..a14331bc7ab0d 100644 --- a/api_docs/kbn_apm_utils.mdx +++ b/api_docs/kbn_apm_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-utils title: "@kbn/apm-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] --- import kbnApmUtilsObj from './kbn_apm_utils.devdocs.json'; diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index c5413b593315e..fcf90f98d9f78 100644 --- a/api_docs/kbn_axe_config.mdx +++ b/api_docs/kbn_axe_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-axe-config title: "@kbn/axe-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/axe-config plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] --- import kbnAxeConfigObj from './kbn_axe_config.devdocs.json'; diff --git a/api_docs/kbn_bazel_packages.mdx b/api_docs/kbn_bazel_packages.mdx index df090bf32f6fb..30f02e6901cc4 100644 --- a/api_docs/kbn_bazel_packages.mdx +++ b/api_docs/kbn_bazel_packages.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-bazel-packages title: "@kbn/bazel-packages" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/bazel-packages plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/bazel-packages'] --- import kbnBazelPackagesObj from './kbn_bazel_packages.devdocs.json'; diff --git a/api_docs/kbn_chart_icons.devdocs.json b/api_docs/kbn_chart_icons.devdocs.json new file mode 100644 index 0000000000000..aad32da9e7286 --- /dev/null +++ b/api_docs/kbn_chart_icons.devdocs.json @@ -0,0 +1,1253 @@ +{ + "id": "@kbn/chart-icons", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.DropIllustration", + "type": "Function", + "tags": [], + "label": "DropIllustration", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/drop_illustration.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.DropIllustration.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/drop_illustration.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisBottom", + "type": "Function", + "tags": [], + "label": "EuiIconAxisBottom", + "description": [], + "signature": [ + "({ title, titleId, ...props }: { title: string; titleId: string; }) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/axis_bottom.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisBottom.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/axis_bottom.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisBottom.$1.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/axis_bottom.tsx", + "deprecated": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisBottom.$1.titleId", + "type": "string", + "tags": [], + "label": "titleId", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/axis_bottom.tsx", + "deprecated": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisLeft", + "type": "Function", + "tags": [], + "label": "EuiIconAxisLeft", + "description": [], + "signature": [ + "({ title, titleId, ...props }: { title: string; titleId: string; }) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/axis_left.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisLeft.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/axis_left.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisLeft.$1.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/axis_left.tsx", + "deprecated": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisLeft.$1.titleId", + "type": "string", + "tags": [], + "label": "titleId", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/axis_left.tsx", + "deprecated": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisRight", + "type": "Function", + "tags": [], + "label": "EuiIconAxisRight", + "description": [], + "signature": [ + "({ title, titleId, ...props }: { title: string; titleId: string; }) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/axis_right.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisRight.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/axis_right.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisRight.$1.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/axis_right.tsx", + "deprecated": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisRight.$1.titleId", + "type": "string", + "tags": [], + "label": "titleId", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/axis_right.tsx", + "deprecated": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisTop", + "type": "Function", + "tags": [], + "label": "EuiIconAxisTop", + "description": [], + "signature": [ + "({ title, titleId, ...props }: { title: string; titleId: string; }) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/axis_top.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisTop.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/axis_top.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisTop.$1.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/axis_top.tsx", + "deprecated": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconAxisTop.$1.titleId", + "type": "string", + "tags": [], + "label": "titleId", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/axis_top.tsx", + "deprecated": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconLegend", + "type": "Function", + "tags": [], + "label": "EuiIconLegend", + "description": [], + "signature": [ + "({ title, titleId, ...props }: { title: string; titleId: string; }) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/legend.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconLegend.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/legend.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconLegend.$1.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/legend.tsx", + "deprecated": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.EuiIconLegend.$1.titleId", + "type": "string", + "tags": [], + "label": "titleId", + "description": [], + "path": "packages/kbn-chart-icons/src/assets/legend.tsx", + "deprecated": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.GlobeIllustration", + "type": "Function", + "tags": [], + "label": "GlobeIllustration", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/globe_illustration.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.GlobeIllustration.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/globe_illustration.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartArea", + "type": "Function", + "tags": [], + "label": "IconChartArea", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_area.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartArea.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_area.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartAreaPercentage", + "type": "Function", + "tags": [], + "label": "IconChartAreaPercentage", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_area_percentage.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartAreaPercentage.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_area_percentage.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartAreaStacked", + "type": "Function", + "tags": [], + "label": "IconChartAreaStacked", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_area_stacked.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartAreaStacked.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_area_stacked.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBar", + "type": "Function", + "tags": [], + "label": "IconChartBar", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBar.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarAnnotations", + "type": "Function", + "tags": [], + "label": "IconChartBarAnnotations", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_annotations.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarAnnotations.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_annotations.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarHorizontal", + "type": "Function", + "tags": [], + "label": "IconChartBarHorizontal", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_horizontal.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarHorizontal.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_horizontal.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarHorizontalPercentage", + "type": "Function", + "tags": [], + "label": "IconChartBarHorizontalPercentage", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_horizontal_percentage.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarHorizontalPercentage.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_horizontal_percentage.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarHorizontalStacked", + "type": "Function", + "tags": [], + "label": "IconChartBarHorizontalStacked", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_horizontal_stacked.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarHorizontalStacked.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_horizontal_stacked.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarPercentage", + "type": "Function", + "tags": [], + "label": "IconChartBarPercentage", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_percentage.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarPercentage.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_percentage.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarReferenceLine", + "type": "Function", + "tags": [], + "label": "IconChartBarReferenceLine", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_reference_line.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarReferenceLine.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_reference_line.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarStacked", + "type": "Function", + "tags": [], + "label": "IconChartBarStacked", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_stacked.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartBarStacked.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_bar_stacked.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartDatatable", + "type": "Function", + "tags": [], + "label": "IconChartDatatable", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_datatable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartDatatable.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_datatable.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartDonut", + "type": "Function", + "tags": [], + "label": "IconChartDonut", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_donut.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartDonut.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_donut.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartHeatmap", + "type": "Function", + "tags": [], + "label": "IconChartHeatmap", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_heatmap.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartHeatmap.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_heatmap.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartHorizontalBullet", + "type": "Function", + "tags": [], + "label": "IconChartHorizontalBullet", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_horizontal_bullet.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartHorizontalBullet.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_horizontal_bullet.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartLine", + "type": "Function", + "tags": [], + "label": "IconChartLine", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_line.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartLine.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_line.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartMetric", + "type": "Function", + "tags": [], + "label": "IconChartMetric", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_metric.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartMetric.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_metric.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartMixedXy", + "type": "Function", + "tags": [], + "label": "IconChartMixedXy", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_mixed_xy.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartMixedXy.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_mixed_xy.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartMosaic", + "type": "Function", + "tags": [], + "label": "IconChartMosaic", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_mosaic.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartMosaic.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_mosaic.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartPie", + "type": "Function", + "tags": [], + "label": "IconChartPie", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_pie.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartPie.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_pie.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartTreemap", + "type": "Function", + "tags": [], + "label": "IconChartTreemap", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_treemap.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartTreemap.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_treemap.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartVerticalBullet", + "type": "Function", + "tags": [], + "label": "IconChartVerticalBullet", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_vertical_bullet.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartVerticalBullet.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_vertical_bullet.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartWaffle", + "type": "Function", + "tags": [], + "label": "IconChartWaffle", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_waffle.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconChartWaffle.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/chart_waffle.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconCircle", + "type": "Function", + "tags": [], + "label": "IconCircle", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/annotation_icons/circle.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconCircle.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/annotation_icons/circle.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconRegionMap", + "type": "Function", + "tags": [], + "label": "IconRegionMap", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/region_map.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconRegionMap.$1", + "type": "Object", + "tags": [], + "label": "{\n title,\n titleId,\n ...props\n}", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/region_map.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconTriangle", + "type": "Function", + "tags": [], + "label": "IconTriangle", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "packages/kbn-chart-icons/src/assets/annotation_icons/triangle.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/chart-icons", + "id": "def-common.IconTriangle.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "packages/kbn-chart-icons/src/assets/annotation_icons/triangle.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_chart_icons.mdx b/api_docs/kbn_chart_icons.mdx new file mode 100644 index 0000000000000..e15c84c31c26d --- /dev/null +++ b/api_docs/kbn_chart_icons.mdx @@ -0,0 +1,30 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnChartIconsPluginApi +slug: /kibana-dev-docs/api/kbn-chart-icons +title: "@kbn/chart-icons" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/chart-icons plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-icons'] +--- +import kbnChartIconsObj from './kbn_chart_icons.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 76 | 0 | 76 | 0 | + +## Common + +### Functions + + diff --git a/api_docs/kbn_ci_stats_core.mdx b/api_docs/kbn_ci_stats_core.mdx index ee8513d72f106..254809a6d1f7d 100644 --- a/api_docs/kbn_ci_stats_core.mdx +++ b/api_docs/kbn_ci_stats_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-core title: "@kbn/ci-stats-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-core plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-core'] --- import kbnCiStatsCoreObj from './kbn_ci_stats_core.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_performance_metrics.mdx b/api_docs/kbn_ci_stats_performance_metrics.mdx index b6c7b9c6caabc..cfac6e2bbac2a 100644 --- a/api_docs/kbn_ci_stats_performance_metrics.mdx +++ b/api_docs/kbn_ci_stats_performance_metrics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-performance-metrics title: "@kbn/ci-stats-performance-metrics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-performance-metrics plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-performance-metrics'] --- import kbnCiStatsPerformanceMetricsObj from './kbn_ci_stats_performance_metrics.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_reporter.mdx b/api_docs/kbn_ci_stats_reporter.mdx index c254fbfe83d08..3eac48be7b0df 100644 --- a/api_docs/kbn_ci_stats_reporter.mdx +++ b/api_docs/kbn_ci_stats_reporter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-reporter title: "@kbn/ci-stats-reporter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-reporter plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-reporter'] --- import kbnCiStatsReporterObj from './kbn_ci_stats_reporter.devdocs.json'; diff --git a/api_docs/kbn_cli_dev_mode.mdx b/api_docs/kbn_cli_dev_mode.mdx index b1a9d53e2b994..4e660d395d984 100644 --- a/api_docs/kbn_cli_dev_mode.mdx +++ b/api_docs/kbn_cli_dev_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cli-dev-mode title: "@kbn/cli-dev-mode" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cli-dev-mode plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] --- import kbnCliDevModeObj from './kbn_cli_dev_mode.devdocs.json'; diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index 1e5e99954b9ca..c552d7cdb70ee 100644 --- a/api_docs/kbn_coloring.mdx +++ b/api_docs/kbn_coloring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-coloring title: "@kbn/coloring" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/coloring plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/coloring'] --- import kbnColoringObj from './kbn_coloring.devdocs.json'; diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index f7b0ccfa1d5ef..2923881891db8 100644 --- a/api_docs/kbn_config.mdx +++ b/api_docs/kbn_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config title: "@kbn/config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config'] --- import kbnConfigObj from './kbn_config.devdocs.json'; diff --git a/api_docs/kbn_config_mocks.mdx b/api_docs/kbn_config_mocks.mdx index 911db3fc9c7f2..d5e4ce5113fbc 100644 --- a/api_docs/kbn_config_mocks.mdx +++ b/api_docs/kbn_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-mocks title: "@kbn/config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-mocks'] --- import kbnConfigMocksObj from './kbn_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index 6e5804cc35f74..a5967a1b0201c 100644 --- a/api_docs/kbn_config_schema.mdx +++ b/api_docs/kbn_config_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-schema title: "@kbn/config-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-schema plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] --- import kbnConfigSchemaObj from './kbn_config_schema.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index d4b13f82c8927..99a3e55b8e2e9 100644 --- a/api_docs/kbn_core_analytics_browser.mdx +++ b/api_docs/kbn_core_analytics_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser title: "@kbn/core-analytics-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser'] --- import kbnCoreAnalyticsBrowserObj from './kbn_core_analytics_browser.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_internal.mdx b/api_docs/kbn_core_analytics_browser_internal.mdx index 5e289135f255e..7a8c720617f59 100644 --- a/api_docs/kbn_core_analytics_browser_internal.mdx +++ b/api_docs/kbn_core_analytics_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-internal title: "@kbn/core-analytics-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-internal'] --- import kbnCoreAnalyticsBrowserInternalObj from './kbn_core_analytics_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_mocks.mdx b/api_docs/kbn_core_analytics_browser_mocks.mdx index 5b2aa0a4d3fb0..745799822d5fa 100644 --- a/api_docs/kbn_core_analytics_browser_mocks.mdx +++ b/api_docs/kbn_core_analytics_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-mocks title: "@kbn/core-analytics-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-mocks'] --- import kbnCoreAnalyticsBrowserMocksObj from './kbn_core_analytics_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index ee8bdbc30e3b3..f36509f058ed9 100644 --- a/api_docs/kbn_core_analytics_server.mdx +++ b/api_docs/kbn_core_analytics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server title: "@kbn/core-analytics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server'] --- import kbnCoreAnalyticsServerObj from './kbn_core_analytics_server.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_internal.mdx b/api_docs/kbn_core_analytics_server_internal.mdx index ca0d5d9684dd2..7df3a89fc7b8b 100644 --- a/api_docs/kbn_core_analytics_server_internal.mdx +++ b/api_docs/kbn_core_analytics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-internal title: "@kbn/core-analytics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-internal'] --- import kbnCoreAnalyticsServerInternalObj from './kbn_core_analytics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_mocks.mdx b/api_docs/kbn_core_analytics_server_mocks.mdx index 1ea924bc33934..664a3112a93aa 100644 --- a/api_docs/kbn_core_analytics_server_mocks.mdx +++ b/api_docs/kbn_core_analytics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-mocks title: "@kbn/core-analytics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-mocks'] --- import kbnCoreAnalyticsServerMocksObj from './kbn_core_analytics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_base_browser_mocks.mdx b/api_docs/kbn_core_base_browser_mocks.mdx index 0c6e6f07bef04..0403ecfd608b0 100644 --- a/api_docs/kbn_core_base_browser_mocks.mdx +++ b/api_docs/kbn_core_base_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-browser-mocks title: "@kbn/core-base-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-browser-mocks'] --- import kbnCoreBaseBrowserMocksObj from './kbn_core_base_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_base_common.mdx b/api_docs/kbn_core_base_common.mdx index 8aec60082bf3d..a834fb3bbdecd 100644 --- a/api_docs/kbn_core_base_common.mdx +++ b/api_docs/kbn_core_base_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-common title: "@kbn/core-base-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-common plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-common'] --- import kbnCoreBaseCommonObj from './kbn_core_base_common.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_internal.mdx b/api_docs/kbn_core_base_server_internal.mdx index a1bc0dbba414d..460b2eb0e2ad6 100644 --- a/api_docs/kbn_core_base_server_internal.mdx +++ b/api_docs/kbn_core_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-internal title: "@kbn/core-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-internal'] --- import kbnCoreBaseServerInternalObj from './kbn_core_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_mocks.mdx b/api_docs/kbn_core_base_server_mocks.mdx index f9a793e03330a..62b7be0845220 100644 --- a/api_docs/kbn_core_base_server_mocks.mdx +++ b/api_docs/kbn_core_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-mocks title: "@kbn/core-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-mocks'] --- import kbnCoreBaseServerMocksObj from './kbn_core_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_common.mdx b/api_docs/kbn_core_capabilities_common.mdx index fe216e5decd35..88ec128e46195 100644 --- a/api_docs/kbn_core_capabilities_common.mdx +++ b/api_docs/kbn_core_capabilities_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-common title: "@kbn/core-capabilities-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-common plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-common'] --- import kbnCoreCapabilitiesCommonObj from './kbn_core_capabilities_common.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server.mdx b/api_docs/kbn_core_capabilities_server.mdx index 47098fcfcbd41..74a48d0ebd92a 100644 --- a/api_docs/kbn_core_capabilities_server.mdx +++ b/api_docs/kbn_core_capabilities_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server title: "@kbn/core-capabilities-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server'] --- import kbnCoreCapabilitiesServerObj from './kbn_core_capabilities_server.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server_mocks.mdx b/api_docs/kbn_core_capabilities_server_mocks.mdx index 4fe988e8429f8..3d3754ac5e20d 100644 --- a/api_docs/kbn_core_capabilities_server_mocks.mdx +++ b/api_docs/kbn_core_capabilities_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server-mocks title: "@kbn/core-capabilities-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server-mocks'] --- import kbnCoreCapabilitiesServerMocksObj from './kbn_core_capabilities_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_config_server_internal.mdx b/api_docs/kbn_core_config_server_internal.mdx index 7c6aa4e4610df..5a951169615a3 100644 --- a/api_docs/kbn_core_config_server_internal.mdx +++ b/api_docs/kbn_core_config_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-config-server-internal title: "@kbn/core-config-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-config-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-config-server-internal'] --- import kbnCoreConfigServerInternalObj from './kbn_core_config_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser.mdx b/api_docs/kbn_core_deprecations_browser.mdx index 398985fc40932..5fd78381685ec 100644 --- a/api_docs/kbn_core_deprecations_browser.mdx +++ b/api_docs/kbn_core_deprecations_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser title: "@kbn/core-deprecations-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser'] --- import kbnCoreDeprecationsBrowserObj from './kbn_core_deprecations_browser.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_internal.mdx b/api_docs/kbn_core_deprecations_browser_internal.mdx index fd4c67481f93f..a723eb168b4c0 100644 --- a/api_docs/kbn_core_deprecations_browser_internal.mdx +++ b/api_docs/kbn_core_deprecations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-internal title: "@kbn/core-deprecations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-internal'] --- import kbnCoreDeprecationsBrowserInternalObj from './kbn_core_deprecations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_mocks.mdx b/api_docs/kbn_core_deprecations_browser_mocks.mdx index c0c225cdd7027..fefd13b56b777 100644 --- a/api_docs/kbn_core_deprecations_browser_mocks.mdx +++ b/api_docs/kbn_core_deprecations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-mocks title: "@kbn/core-deprecations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-mocks'] --- import kbnCoreDeprecationsBrowserMocksObj from './kbn_core_deprecations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_common.mdx b/api_docs/kbn_core_deprecations_common.mdx index 06c4f9c0707d1..dabd876b8a02c 100644 --- a/api_docs/kbn_core_deprecations_common.mdx +++ b/api_docs/kbn_core_deprecations_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-common title: "@kbn/core-deprecations-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-common plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-common'] --- import kbnCoreDeprecationsCommonObj from './kbn_core_deprecations_common.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser.mdx b/api_docs/kbn_core_doc_links_browser.mdx index b4c59038fd7c2..fd587ebcf9743 100644 --- a/api_docs/kbn_core_doc_links_browser.mdx +++ b/api_docs/kbn_core_doc_links_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser title: "@kbn/core-doc-links-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser'] --- import kbnCoreDocLinksBrowserObj from './kbn_core_doc_links_browser.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser_mocks.mdx b/api_docs/kbn_core_doc_links_browser_mocks.mdx index d28b1e5342921..fc126aa7d7dde 100644 --- a/api_docs/kbn_core_doc_links_browser_mocks.mdx +++ b/api_docs/kbn_core_doc_links_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser-mocks title: "@kbn/core-doc-links-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser-mocks'] --- import kbnCoreDocLinksBrowserMocksObj from './kbn_core_doc_links_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server.mdx b/api_docs/kbn_core_doc_links_server.mdx index cf514e7c6df72..1f95047b4792b 100644 --- a/api_docs/kbn_core_doc_links_server.mdx +++ b/api_docs/kbn_core_doc_links_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server title: "@kbn/core-doc-links-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server'] --- import kbnCoreDocLinksServerObj from './kbn_core_doc_links_server.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server_mocks.mdx b/api_docs/kbn_core_doc_links_server_mocks.mdx index edfe32d16b05d..18b28851864c1 100644 --- a/api_docs/kbn_core_doc_links_server_mocks.mdx +++ b/api_docs/kbn_core_doc_links_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server-mocks title: "@kbn/core-doc-links-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server-mocks'] --- import kbnCoreDocLinksServerMocksObj from './kbn_core_doc_links_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx index 7f682e5b7c374..e81db294cca91 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-internal title: "@kbn/core-elasticsearch-client-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-internal'] --- import kbnCoreElasticsearchClientServerInternalObj from './kbn_core_elasticsearch_client_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.devdocs.json b/api_docs/kbn_core_elasticsearch_client_server_mocks.devdocs.json index 16ccc36c7ac60..ebe913276adcb 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_mocks.devdocs.json +++ b/api_docs/kbn_core_elasticsearch_client_server_mocks.devdocs.json @@ -257,7 +257,17 @@ "DeleteRequest", ", options?: ", "TransportRequestOptions", - " | undefined]>; name: string | symbol; transform: ", + " | undefined]>; cluster: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", + ">; eql: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -283,27 +293,7 @@ "SearchRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; cluster: ", - { - "pluginId": "@kbn/core-elasticsearch-client-server-mocks", - "scope": "server", - "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", - "section": "def-server.DeeplyMockedApi", - "text": "DeeplyMockedApi" - }, - "<", - "default", - ">; eql: ", - { - "pluginId": "@kbn/core-elasticsearch-client-server-mocks", - "scope": "server", - "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", - "section": "def-server.DeeplyMockedApi", - "text": "DeeplyMockedApi" - }, - "<", - "default", - ">; create: ", + " | undefined]>; create: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -339,7 +329,7 @@ }, "<", "default", - ">; index: ", + ">; name: string | symbol; index: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -1223,6 +1213,16 @@ }, "<", "default", + ">; transform: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; updateByQuery: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -1365,7 +1365,17 @@ "DeleteRequest", ", options?: ", "TransportRequestOptions", - " | undefined]>; name: string | symbol; transform: ", + " | undefined]>; cluster: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", + ">; eql: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -1391,27 +1401,7 @@ "SearchRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; cluster: ", - { - "pluginId": "@kbn/core-elasticsearch-client-server-mocks", - "scope": "server", - "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", - "section": "def-server.DeeplyMockedApi", - "text": "DeeplyMockedApi" - }, - "<", - "default", - ">; eql: ", - { - "pluginId": "@kbn/core-elasticsearch-client-server-mocks", - "scope": "server", - "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", - "section": "def-server.DeeplyMockedApi", - "text": "DeeplyMockedApi" - }, - "<", - "default", - ">; create: ", + " | undefined]>; create: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -1447,7 +1437,7 @@ }, "<", "default", - ">; index: ", + ">; name: string | symbol; index: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -2331,6 +2321,16 @@ }, "<", "default", + ">; transform: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; updateByQuery: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -2429,7 +2429,17 @@ "DeleteRequest", ", options?: ", "TransportRequestOptions", - " | undefined]>; name: string | symbol; transform: ", + " | undefined]>; cluster: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", + ">; eql: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -2455,27 +2465,7 @@ "SearchRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; cluster: ", - { - "pluginId": "@kbn/core-elasticsearch-client-server-mocks", - "scope": "server", - "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", - "section": "def-server.DeeplyMockedApi", - "text": "DeeplyMockedApi" - }, - "<", - "default", - ">; eql: ", - { - "pluginId": "@kbn/core-elasticsearch-client-server-mocks", - "scope": "server", - "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", - "section": "def-server.DeeplyMockedApi", - "text": "DeeplyMockedApi" - }, - "<", - "default", - ">; create: ", + " | undefined]>; create: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -2511,7 +2501,7 @@ }, "<", "default", - ">; index: ", + ">; name: string | symbol; index: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -3395,6 +3385,16 @@ }, "<", "default", + ">; transform: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; updateByQuery: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", @@ -3558,7 +3558,17 @@ "DeleteRequest", ", options?: ", "TransportRequestOptions", - " | undefined]>; name: string | symbol; transform: ", + " | undefined]>; cluster: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", + ">; eql: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -3584,27 +3594,7 @@ "SearchRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined]>; cluster: ", - { - "pluginId": "@kbn/core-elasticsearch-client-server-mocks", - "scope": "server", - "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", - "section": "def-server.DeeplyMockedApi", - "text": "DeeplyMockedApi" - }, - "<", - "default", - ">; eql: ", - { - "pluginId": "@kbn/core-elasticsearch-client-server-mocks", - "scope": "server", - "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", - "section": "def-server.DeeplyMockedApi", - "text": "DeeplyMockedApi" - }, - "<", - "default", - ">; create: ", + " | undefined]>; create: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -3640,7 +3630,7 @@ }, "<", "default", - ">; index: ", + ">; name: string | symbol; index: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", "scope": "server", @@ -4524,6 +4514,16 @@ }, "<", "default", + ">; transform: ", + { + "pluginId": "@kbn/core-elasticsearch-client-server-mocks", + "scope": "server", + "docId": "kibKbnCoreElasticsearchClientServerMocksPluginApi", + "section": "def-server.DeeplyMockedApi", + "text": "DeeplyMockedApi" + }, + "<", + "default", ">; updateByQuery: ", { "pluginId": "@kbn/core-elasticsearch-client-server-mocks", diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx index dd523fcb940b0..a90f68dc84f87 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-mocks title: "@kbn/core-elasticsearch-client-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-mocks'] --- import kbnCoreElasticsearchClientServerMocksObj from './kbn_core_elasticsearch_client_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server.devdocs.json b/api_docs/kbn_core_elasticsearch_server.devdocs.json index ab17c1ee287ce..71b802e242b1a 100644 --- a/api_docs/kbn_core_elasticsearch_server.devdocs.json +++ b/api_docs/kbn_core_elasticsearch_server.devdocs.json @@ -882,7 +882,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -950,7 +948,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -1962,6 +1960,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -2473,7 +2473,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -2541,7 +2539,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -3553,6 +3551,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -3676,7 +3676,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -3744,7 +3742,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -4756,6 +4754,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -5113,7 +5113,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -5181,7 +5179,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -6193,6 +6191,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", diff --git a/api_docs/kbn_core_elasticsearch_server.mdx b/api_docs/kbn_core_elasticsearch_server.mdx index b65bb86533838..09a5dfa1860ff 100644 --- a/api_docs/kbn_core_elasticsearch_server.mdx +++ b/api_docs/kbn_core_elasticsearch_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server title: "@kbn/core-elasticsearch-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server'] --- import kbnCoreElasticsearchServerObj from './kbn_core_elasticsearch_server.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_internal.devdocs.json b/api_docs/kbn_core_elasticsearch_server_internal.devdocs.json index b86ca4789ddaf..d05f0fed58931 100644 --- a/api_docs/kbn_core_elasticsearch_server_internal.devdocs.json +++ b/api_docs/kbn_core_elasticsearch_server_internal.devdocs.json @@ -96,7 +96,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -164,7 +162,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -1176,6 +1174,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -1655,7 +1655,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -1723,7 +1721,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -2735,6 +2733,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", diff --git a/api_docs/kbn_core_elasticsearch_server_internal.mdx b/api_docs/kbn_core_elasticsearch_server_internal.mdx index d7b8e1c57b6fa..0a45d168e696f 100644 --- a/api_docs/kbn_core_elasticsearch_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-internal title: "@kbn/core-elasticsearch-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-internal'] --- import kbnCoreElasticsearchServerInternalObj from './kbn_core_elasticsearch_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_server_mocks.mdx index 176138dc4423a..86b8bc9c13b41 100644 --- a/api_docs/kbn_core_elasticsearch_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-mocks title: "@kbn/core-elasticsearch-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-mocks'] --- import kbnCoreElasticsearchServerMocksObj from './kbn_core_elasticsearch_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_internal.mdx b/api_docs/kbn_core_environment_server_internal.mdx index de548752ac006..c536f9c5ea0ba 100644 --- a/api_docs/kbn_core_environment_server_internal.mdx +++ b/api_docs/kbn_core_environment_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-internal title: "@kbn/core-environment-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-internal'] --- import kbnCoreEnvironmentServerInternalObj from './kbn_core_environment_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_mocks.mdx b/api_docs/kbn_core_environment_server_mocks.mdx index 83f2ee0b81fe3..b94917f722255 100644 --- a/api_docs/kbn_core_environment_server_mocks.mdx +++ b/api_docs/kbn_core_environment_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-mocks title: "@kbn/core-environment-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-mocks'] --- import kbnCoreEnvironmentServerMocksObj from './kbn_core_environment_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser.mdx b/api_docs/kbn_core_execution_context_browser.mdx index 2664332647e47..e1d30875f4d61 100644 --- a/api_docs/kbn_core_execution_context_browser.mdx +++ b/api_docs/kbn_core_execution_context_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser title: "@kbn/core-execution-context-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser'] --- import kbnCoreExecutionContextBrowserObj from './kbn_core_execution_context_browser.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_internal.mdx b/api_docs/kbn_core_execution_context_browser_internal.mdx index 2cf344cf8cd01..df721518ade4e 100644 --- a/api_docs/kbn_core_execution_context_browser_internal.mdx +++ b/api_docs/kbn_core_execution_context_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-internal title: "@kbn/core-execution-context-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-internal'] --- import kbnCoreExecutionContextBrowserInternalObj from './kbn_core_execution_context_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_mocks.mdx b/api_docs/kbn_core_execution_context_browser_mocks.mdx index 23cee7bc0ca32..29f6e5f423f89 100644 --- a/api_docs/kbn_core_execution_context_browser_mocks.mdx +++ b/api_docs/kbn_core_execution_context_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-mocks title: "@kbn/core-execution-context-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-mocks'] --- import kbnCoreExecutionContextBrowserMocksObj from './kbn_core_execution_context_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_common.mdx b/api_docs/kbn_core_execution_context_common.mdx index f01f626da60c1..b81f424104cdf 100644 --- a/api_docs/kbn_core_execution_context_common.mdx +++ b/api_docs/kbn_core_execution_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-common title: "@kbn/core-execution-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-common plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-common'] --- import kbnCoreExecutionContextCommonObj from './kbn_core_execution_context_common.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server.mdx b/api_docs/kbn_core_execution_context_server.mdx index 9e946fa3e6e54..d566a343d7593 100644 --- a/api_docs/kbn_core_execution_context_server.mdx +++ b/api_docs/kbn_core_execution_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server title: "@kbn/core-execution-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server'] --- import kbnCoreExecutionContextServerObj from './kbn_core_execution_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_internal.mdx b/api_docs/kbn_core_execution_context_server_internal.mdx index 73289f80ea812..18b7e18629e39 100644 --- a/api_docs/kbn_core_execution_context_server_internal.mdx +++ b/api_docs/kbn_core_execution_context_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-internal title: "@kbn/core-execution-context-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-internal'] --- import kbnCoreExecutionContextServerInternalObj from './kbn_core_execution_context_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_mocks.mdx b/api_docs/kbn_core_execution_context_server_mocks.mdx index f6d5c6a77d2bc..d6692a43a46c9 100644 --- a/api_docs/kbn_core_execution_context_server_mocks.mdx +++ b/api_docs/kbn_core_execution_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-mocks title: "@kbn/core-execution-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-mocks'] --- import kbnCoreExecutionContextServerMocksObj from './kbn_core_execution_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser.mdx b/api_docs/kbn_core_fatal_errors_browser.mdx index 1d24b298fc650..d08d70027d79f 100644 --- a/api_docs/kbn_core_fatal_errors_browser.mdx +++ b/api_docs/kbn_core_fatal_errors_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser title: "@kbn/core-fatal-errors-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser'] --- import kbnCoreFatalErrorsBrowserObj from './kbn_core_fatal_errors_browser.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx index c6620ea9c0737..9a0599f073e53 100644 --- a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx +++ b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser-mocks title: "@kbn/core-fatal-errors-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser-mocks'] --- import kbnCoreFatalErrorsBrowserMocksObj from './kbn_core_fatal_errors_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser.mdx b/api_docs/kbn_core_http_browser.mdx index 2939f67886c5e..ae80c851095d9 100644 --- a/api_docs/kbn_core_http_browser.mdx +++ b/api_docs/kbn_core_http_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser title: "@kbn/core-http-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser'] --- import kbnCoreHttpBrowserObj from './kbn_core_http_browser.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_internal.mdx b/api_docs/kbn_core_http_browser_internal.mdx index 8e0579af4d3e8..ee67080afb77f 100644 --- a/api_docs/kbn_core_http_browser_internal.mdx +++ b/api_docs/kbn_core_http_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-internal title: "@kbn/core-http-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-internal'] --- import kbnCoreHttpBrowserInternalObj from './kbn_core_http_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_mocks.mdx b/api_docs/kbn_core_http_browser_mocks.mdx index bea5d75e2fcfc..1c5e6894a840f 100644 --- a/api_docs/kbn_core_http_browser_mocks.mdx +++ b/api_docs/kbn_core_http_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-mocks title: "@kbn/core-http-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-mocks'] --- import kbnCoreHttpBrowserMocksObj from './kbn_core_http_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_common.mdx b/api_docs/kbn_core_http_common.mdx index 601d5dd5f0232..5f4c6227e0c45 100644 --- a/api_docs/kbn_core_http_common.mdx +++ b/api_docs/kbn_core_http_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-common title: "@kbn/core-http-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-common plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-common'] --- import kbnCoreHttpCommonObj from './kbn_core_http_common.devdocs.json'; diff --git a/api_docs/kbn_core_http_context_server_mocks.mdx b/api_docs/kbn_core_http_context_server_mocks.mdx index fe1db70580fcb..0149e5a1ef736 100644 --- a/api_docs/kbn_core_http_context_server_mocks.mdx +++ b/api_docs/kbn_core_http_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-context-server-mocks title: "@kbn/core-http-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-context-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-context-server-mocks'] --- import kbnCoreHttpContextServerMocksObj from './kbn_core_http_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_internal.mdx b/api_docs/kbn_core_http_router_server_internal.mdx index 266f1169e19c5..0c0189dec35c2 100644 --- a/api_docs/kbn_core_http_router_server_internal.mdx +++ b/api_docs/kbn_core_http_router_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-internal title: "@kbn/core-http-router-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-internal'] --- import kbnCoreHttpRouterServerInternalObj from './kbn_core_http_router_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_mocks.mdx b/api_docs/kbn_core_http_router_server_mocks.mdx index ec7e39ce80ec3..13f6a86caed93 100644 --- a/api_docs/kbn_core_http_router_server_mocks.mdx +++ b/api_docs/kbn_core_http_router_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-mocks title: "@kbn/core-http-router-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-mocks'] --- import kbnCoreHttpRouterServerMocksObj from './kbn_core_http_router_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index fe2df928979d4..0bb31ce2eecea 100644 --- a/api_docs/kbn_core_http_server.mdx +++ b/api_docs/kbn_core_http_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server title: "@kbn/core-http-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] --- import kbnCoreHttpServerObj from './kbn_core_http_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index 7669ac92afc5a..19418ae307e27 100644 --- a/api_docs/kbn_core_http_server_internal.mdx +++ b/api_docs/kbn_core_http_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-internal title: "@kbn/core-http-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] --- import kbnCoreHttpServerInternalObj from './kbn_core_http_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index b8f704373b482..0ad1c9167d6d0 100644 --- a/api_docs/kbn_core_http_server_mocks.mdx +++ b/api_docs/kbn_core_http_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-mocks title: "@kbn/core-http-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-mocks'] --- import kbnCoreHttpServerMocksObj from './kbn_core_http_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser.mdx b/api_docs/kbn_core_i18n_browser.mdx index 26f66d8870134..4f748bb1eb1b4 100644 --- a/api_docs/kbn_core_i18n_browser.mdx +++ b/api_docs/kbn_core_i18n_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser title: "@kbn/core-i18n-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser'] --- import kbnCoreI18nBrowserObj from './kbn_core_i18n_browser.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser_mocks.mdx b/api_docs/kbn_core_i18n_browser_mocks.mdx index 994d881fb39eb..47693b62e96aa 100644 --- a/api_docs/kbn_core_i18n_browser_mocks.mdx +++ b/api_docs/kbn_core_i18n_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser-mocks title: "@kbn/core-i18n-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser-mocks'] --- import kbnCoreI18nBrowserMocksObj from './kbn_core_i18n_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser.mdx b/api_docs/kbn_core_injected_metadata_browser.mdx index e7fd242ccdcba..00954b3bb5b9f 100644 --- a/api_docs/kbn_core_injected_metadata_browser.mdx +++ b/api_docs/kbn_core_injected_metadata_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser title: "@kbn/core-injected-metadata-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser'] --- import kbnCoreInjectedMetadataBrowserObj from './kbn_core_injected_metadata_browser.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx index b8955271cf3f9..7561f8d543fba 100644 --- a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx +++ b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser-mocks title: "@kbn/core-injected-metadata-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser-mocks'] --- import kbnCoreInjectedMetadataBrowserMocksObj from './kbn_core_injected_metadata_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_internal.mdx b/api_docs/kbn_core_integrations_browser_internal.mdx index d06b56834a485..7f578f29af98f 100644 --- a/api_docs/kbn_core_integrations_browser_internal.mdx +++ b/api_docs/kbn_core_integrations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-internal title: "@kbn/core-integrations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-internal'] --- import kbnCoreIntegrationsBrowserInternalObj from './kbn_core_integrations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_mocks.mdx b/api_docs/kbn_core_integrations_browser_mocks.mdx index ba5cb4c53c7fb..6ed8ee5e8fc1b 100644 --- a/api_docs/kbn_core_integrations_browser_mocks.mdx +++ b/api_docs/kbn_core_integrations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-mocks title: "@kbn/core-integrations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-mocks'] --- import kbnCoreIntegrationsBrowserMocksObj from './kbn_core_integrations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server.devdocs.json b/api_docs/kbn_core_logging_server.devdocs.json index 1c62152f792f8..0e4ef7660c429 100644 --- a/api_docs/kbn_core_logging_server.devdocs.json +++ b/api_docs/kbn_core_logging_server.devdocs.json @@ -203,7 +203,7 @@ "label": "level", "description": [], "signature": [ - "\"error\" | \"all\" | \"off\" | \"info\" | \"debug\" | \"trace\" | \"warn\" | \"fatal\"" + "\"error\" | \"all\" | \"info\" | \"debug\" | \"off\" | \"trace\" | \"warn\" | \"fatal\"" ], "path": "packages/core/logging/core-logging-server/src/logger.ts", "deprecated": false diff --git a/api_docs/kbn_core_logging_server.mdx b/api_docs/kbn_core_logging_server.mdx index a96ba4e743a7f..d8218355ffb2a 100644 --- a/api_docs/kbn_core_logging_server.mdx +++ b/api_docs/kbn_core_logging_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server title: "@kbn/core-logging-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server'] --- import kbnCoreLoggingServerObj from './kbn_core_logging_server.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_internal.devdocs.json b/api_docs/kbn_core_logging_server_internal.devdocs.json index 7b04157c02296..dbef8abb628d9 100644 --- a/api_docs/kbn_core_logging_server_internal.devdocs.json +++ b/api_docs/kbn_core_logging_server_internal.devdocs.json @@ -142,7 +142,7 @@ "AppenderConfigType", ">>; loggers: ", "Type", - "[]>; }>" + "[]>; }>" ], "path": "packages/core/logging/core-logging-server-internal/src/logging_config.ts", "deprecated": false, @@ -165,7 +165,7 @@ "Type", "; level: ", "Type", - "<\"error\" | \"all\" | \"off\" | \"info\" | \"debug\" | \"trace\" | \"warn\" | \"fatal\">; }>" + "<\"error\" | \"all\" | \"info\" | \"debug\" | \"off\" | \"trace\" | \"warn\" | \"fatal\">; }>" ], "path": "packages/core/logging/core-logging-server-internal/src/logging_config.ts", "deprecated": false, diff --git a/api_docs/kbn_core_logging_server_internal.mdx b/api_docs/kbn_core_logging_server_internal.mdx index 3cc8852a012f0..4de18c9ad80bf 100644 --- a/api_docs/kbn_core_logging_server_internal.mdx +++ b/api_docs/kbn_core_logging_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-internal title: "@kbn/core-logging-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-internal'] --- import kbnCoreLoggingServerInternalObj from './kbn_core_logging_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index 549aafebcc8ff..7888fbe99e446 100644 --- a/api_docs/kbn_core_logging_server_mocks.mdx +++ b/api_docs/kbn_core_logging_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-mocks title: "@kbn/core-logging-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-mocks'] --- import kbnCoreLoggingServerMocksObj from './kbn_core_logging_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_internal.mdx b/api_docs/kbn_core_metrics_collectors_server_internal.mdx index a030c663f9667..e02038e325924 100644 --- a/api_docs/kbn_core_metrics_collectors_server_internal.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-internal title: "@kbn/core-metrics-collectors-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-internal'] --- import kbnCoreMetricsCollectorsServerInternalObj from './kbn_core_metrics_collectors_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx index 146325c7c0f79..8678aaced144c 100644 --- a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-mocks title: "@kbn/core-metrics-collectors-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-mocks'] --- import kbnCoreMetricsCollectorsServerMocksObj from './kbn_core_metrics_collectors_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server.mdx b/api_docs/kbn_core_metrics_server.mdx index f39ceb8ff53ea..9ed3a21ad56a4 100644 --- a/api_docs/kbn_core_metrics_server.mdx +++ b/api_docs/kbn_core_metrics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server title: "@kbn/core-metrics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server'] --- import kbnCoreMetricsServerObj from './kbn_core_metrics_server.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_internal.mdx b/api_docs/kbn_core_metrics_server_internal.mdx index 64a18468faab0..9cbafa5d52179 100644 --- a/api_docs/kbn_core_metrics_server_internal.mdx +++ b/api_docs/kbn_core_metrics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-internal title: "@kbn/core-metrics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-internal'] --- import kbnCoreMetricsServerInternalObj from './kbn_core_metrics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_mocks.mdx b/api_docs/kbn_core_metrics_server_mocks.mdx index a16252fc2bd5e..abe7d0b334d8c 100644 --- a/api_docs/kbn_core_metrics_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-mocks title: "@kbn/core-metrics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-mocks'] --- import kbnCoreMetricsServerMocksObj from './kbn_core_metrics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_mount_utils_browser.mdx b/api_docs/kbn_core_mount_utils_browser.mdx index 4938c285d34ac..f1f8727b9eee7 100644 --- a/api_docs/kbn_core_mount_utils_browser.mdx +++ b/api_docs/kbn_core_mount_utils_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-mount-utils-browser title: "@kbn/core-mount-utils-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-mount-utils-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-mount-utils-browser'] --- import kbnCoreMountUtilsBrowserObj from './kbn_core_mount_utils_browser.devdocs.json'; diff --git a/api_docs/kbn_core_mount_utils_browser_internal.mdx b/api_docs/kbn_core_mount_utils_browser_internal.mdx index 7f06a733ffb04..9f9061bd2db2f 100644 --- a/api_docs/kbn_core_mount_utils_browser_internal.mdx +++ b/api_docs/kbn_core_mount_utils_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-mount-utils-browser-internal title: "@kbn/core-mount-utils-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-mount-utils-browser-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-mount-utils-browser-internal'] --- import kbnCoreMountUtilsBrowserInternalObj from './kbn_core_mount_utils_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_node_server.mdx b/api_docs/kbn_core_node_server.mdx index 83667cf09fbdf..249929402bb4c 100644 --- a/api_docs/kbn_core_node_server.mdx +++ b/api_docs/kbn_core_node_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server title: "@kbn/core-node-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server'] --- import kbnCoreNodeServerObj from './kbn_core_node_server.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_internal.mdx b/api_docs/kbn_core_node_server_internal.mdx index 6454ed38da82a..232d8c9b6ad1b 100644 --- a/api_docs/kbn_core_node_server_internal.mdx +++ b/api_docs/kbn_core_node_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-internal title: "@kbn/core-node-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-internal'] --- import kbnCoreNodeServerInternalObj from './kbn_core_node_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_mocks.mdx b/api_docs/kbn_core_node_server_mocks.mdx index be84dfbc6f6f7..1dc7820421fc8 100644 --- a/api_docs/kbn_core_node_server_mocks.mdx +++ b/api_docs/kbn_core_node_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-mocks title: "@kbn/core-node-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-mocks'] --- import kbnCoreNodeServerMocksObj from './kbn_core_node_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser.devdocs.json b/api_docs/kbn_core_notifications_browser.devdocs.json index 6ca21edf2dd67..bab2a6417b824 100644 --- a/api_docs/kbn_core_notifications_browser.devdocs.json +++ b/api_docs/kbn_core_notifications_browser.devdocs.json @@ -651,7 +651,7 @@ "signature": [ "Pick<", "Toast", - ", \"children\" | \"onError\" | \"color\" | \"className\" | \"lang\" | \"style\" | \"role\" | \"tabIndex\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChange\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClick\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"data-test-subj\" | \"hidden\" | \"security\" | \"defaultValue\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\"> & { title?: string | ", + ", \"children\" | \"onError\" | \"hidden\" | \"color\" | \"className\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\" | \"data-test-subj\"> & { title?: string | ", "MountPoint", " | undefined; text?: string | ", "MountPoint", @@ -696,7 +696,7 @@ "signature": [ "Pick<", "Toast", - ", \"children\" | \"onError\" | \"color\" | \"className\" | \"lang\" | \"style\" | \"role\" | \"tabIndex\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChange\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClick\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"data-test-subj\" | \"hidden\" | \"security\" | \"defaultValue\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\"> & { title?: string | ", + ", \"children\" | \"onError\" | \"hidden\" | \"color\" | \"className\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"toastLifeTimeMs\" | \"iconType\" | \"onClose\" | \"data-test-subj\"> & { title?: string | ", "MountPoint", " | undefined; text?: string | ", "MountPoint", diff --git a/api_docs/kbn_core_notifications_browser.mdx b/api_docs/kbn_core_notifications_browser.mdx index 130d2cadb3cbc..8b5697e29e1bc 100644 --- a/api_docs/kbn_core_notifications_browser.mdx +++ b/api_docs/kbn_core_notifications_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser title: "@kbn/core-notifications-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser'] --- import kbnCoreNotificationsBrowserObj from './kbn_core_notifications_browser.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_internal.mdx b/api_docs/kbn_core_notifications_browser_internal.mdx index 0db9205dec321..a670d97534b1a 100644 --- a/api_docs/kbn_core_notifications_browser_internal.mdx +++ b/api_docs/kbn_core_notifications_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-internal title: "@kbn/core-notifications-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-internal'] --- import kbnCoreNotificationsBrowserInternalObj from './kbn_core_notifications_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_mocks.mdx b/api_docs/kbn_core_notifications_browser_mocks.mdx index d1f90c8e011fd..489c0180a7f74 100644 --- a/api_docs/kbn_core_notifications_browser_mocks.mdx +++ b/api_docs/kbn_core_notifications_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-mocks title: "@kbn/core-notifications-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-mocks'] --- import kbnCoreNotificationsBrowserMocksObj from './kbn_core_notifications_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser.devdocs.json b/api_docs/kbn_core_overlays_browser.devdocs.json index 37ccf6337584b..dc76f84740ba1 100644 --- a/api_docs/kbn_core_overlays_browser.devdocs.json +++ b/api_docs/kbn_core_overlays_browser.devdocs.json @@ -293,7 +293,7 @@ "label": "size", "description": [], "signature": [ - "\"s\" | \"m\" | \"l\" | undefined" + "\"m\" | \"s\" | \"l\" | undefined" ], "path": "packages/core/overlays/core-overlays-browser/src/flyout.ts", "deprecated": false diff --git a/api_docs/kbn_core_overlays_browser.mdx b/api_docs/kbn_core_overlays_browser.mdx index 0b85a207c18d2..fc6dbb27609db 100644 --- a/api_docs/kbn_core_overlays_browser.mdx +++ b/api_docs/kbn_core_overlays_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser title: "@kbn/core-overlays-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser'] --- import kbnCoreOverlaysBrowserObj from './kbn_core_overlays_browser.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_internal.mdx b/api_docs/kbn_core_overlays_browser_internal.mdx index 098451f46fb7a..ff891d2b6cc6b 100644 --- a/api_docs/kbn_core_overlays_browser_internal.mdx +++ b/api_docs/kbn_core_overlays_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-internal title: "@kbn/core-overlays-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-internal'] --- import kbnCoreOverlaysBrowserInternalObj from './kbn_core_overlays_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_mocks.mdx b/api_docs/kbn_core_overlays_browser_mocks.mdx index 510ecca45ec08..229ca743a2ce0 100644 --- a/api_docs/kbn_core_overlays_browser_mocks.mdx +++ b/api_docs/kbn_core_overlays_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-mocks title: "@kbn/core-overlays-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-mocks'] --- import kbnCoreOverlaysBrowserMocksObj from './kbn_core_overlays_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server.mdx b/api_docs/kbn_core_preboot_server.mdx index 88f3e9e689920..7c406e1fb0af6 100644 --- a/api_docs/kbn_core_preboot_server.mdx +++ b/api_docs/kbn_core_preboot_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server title: "@kbn/core-preboot-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server'] --- import kbnCorePrebootServerObj from './kbn_core_preboot_server.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server_mocks.mdx b/api_docs/kbn_core_preboot_server_mocks.mdx index 6cced6e99a9d6..546ae71d30209 100644 --- a/api_docs/kbn_core_preboot_server_mocks.mdx +++ b/api_docs/kbn_core_preboot_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server-mocks title: "@kbn/core-preboot-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server-mocks'] --- import kbnCorePrebootServerMocksObj from './kbn_core_preboot_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_browser.devdocs.json b/api_docs/kbn_core_saved_objects_api_browser.devdocs.json index 84e904ed0d0aa..82b771de6f513 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.devdocs.json +++ b/api_docs/kbn_core_saved_objects_api_browser.devdocs.json @@ -1675,9 +1675,9 @@ "label": "SavedObjectsFindOptions", "description": [], "signature": [ - "{ type: string | string[]; filter?: any; search?: string | undefined; page?: number | undefined; aggs?: Record | undefined; fields?: string[] | undefined; perPage?: number | undefined; sortField?: string | undefined; searchFields?: string[] | undefined; hasReference?: ", + "> | undefined; fields?: string[] | undefined; page?: number | undefined; perPage?: number | undefined; sortField?: string | undefined; searchFields?: string[] | undefined; hasReference?: ", "SavedObjectsFindOptionsReference", " | ", "SavedObjectsFindOptionsReference", diff --git a/api_docs/kbn_core_saved_objects_api_browser.mdx b/api_docs/kbn_core_saved_objects_api_browser.mdx index 1d05ef6cd5218..9a560592e3ea2 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.mdx +++ b/api_docs/kbn_core_saved_objects_api_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-browser title: "@kbn/core-saved-objects-api-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-browser'] --- import kbnCoreSavedObjectsApiBrowserObj from './kbn_core_saved_objects_api_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server.mdx b/api_docs/kbn_core_saved_objects_api_server.mdx index 3152ab78b0524..78c00a6865fe9 100644 --- a/api_docs/kbn_core_saved_objects_api_server.mdx +++ b/api_docs/kbn_core_saved_objects_api_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server title: "@kbn/core-saved-objects-api-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server'] --- import kbnCoreSavedObjectsApiServerObj from './kbn_core_saved_objects_api_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser.mdx b/api_docs/kbn_core_saved_objects_browser.mdx index 0aa3ef7327840..8087c874029cd 100644 --- a/api_docs/kbn_core_saved_objects_browser.mdx +++ b/api_docs/kbn_core_saved_objects_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser title: "@kbn/core-saved-objects-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser'] --- import kbnCoreSavedObjectsBrowserObj from './kbn_core_saved_objects_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_internal.mdx b/api_docs/kbn_core_saved_objects_browser_internal.mdx index 8a1f67d842596..3ba8459cfe797 100644 --- a/api_docs/kbn_core_saved_objects_browser_internal.mdx +++ b/api_docs/kbn_core_saved_objects_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-internal title: "@kbn/core-saved-objects-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-internal'] --- import kbnCoreSavedObjectsBrowserInternalObj from './kbn_core_saved_objects_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_mocks.devdocs.json b/api_docs/kbn_core_saved_objects_browser_mocks.devdocs.json index 8c9a3906a2504..17dd93fd31b18 100644 --- a/api_docs/kbn_core_saved_objects_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_saved_objects_browser_mocks.devdocs.json @@ -90,13 +90,12 @@ "SavedObjectsClientContract", ", savedObject: ", "SavedObject", - ") => ", - "SimpleSavedObjectImpl", - "" + ") => jest.Mocked<", + "SimpleSavedObject", + ">" ], "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "@kbn/core-saved-objects-browser-mocks", @@ -109,7 +108,8 @@ "SavedObjectsClientContract" ], "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts", - "deprecated": false + "deprecated": false, + "isRequired": true }, { "parentPluginId": "@kbn/core-saved-objects-browser-mocks", @@ -123,9 +123,11 @@ "" ], "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts", - "deprecated": false + "deprecated": false, + "isRequired": true } - ] + ], + "returnComment": [] } ], "initialIsOpen": false diff --git a/api_docs/kbn_core_saved_objects_browser_mocks.mdx b/api_docs/kbn_core_saved_objects_browser_mocks.mdx index db07fc22a58de..82bb5388e16be 100644 --- a/api_docs/kbn_core_saved_objects_browser_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-mocks title: "@kbn/core-saved-objects-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-mocks'] --- import kbnCoreSavedObjectsBrowserMocksObj from './kbn_core_saved_objects_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_common.mdx b/api_docs/kbn_core_saved_objects_common.mdx index c6e5f8ac62602..e83d2b7e021fc 100644 --- a/api_docs/kbn_core_saved_objects_common.mdx +++ b/api_docs/kbn_core_saved_objects_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-common title: "@kbn/core-saved-objects-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-common plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-common'] --- import kbnCoreSavedObjectsCommonObj from './kbn_core_saved_objects_common.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server.mdx b/api_docs/kbn_core_saved_objects_server.mdx index d49a50f45f3bc..c71468f34f370 100644 --- a/api_docs/kbn_core_saved_objects_server.mdx +++ b/api_docs/kbn_core_saved_objects_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server title: "@kbn/core-saved-objects-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server'] --- import kbnCoreSavedObjectsServerObj from './kbn_core_saved_objects_server.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx index b97c408baf2a5..6d4f10f877f04 100644 --- a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx +++ b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-deprecations-getters title: "@kbn/core-test-helpers-deprecations-getters" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-deprecations-getters plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-deprecations-getters'] --- import kbnCoreTestHelpersDeprecationsGettersObj from './kbn_core_test_helpers_deprecations_getters.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx index b752b145e45e6..d4e895dcdb7c4 100644 --- a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx +++ b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-http-setup-browser title: "@kbn/core-test-helpers-http-setup-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-http-setup-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-http-setup-browser'] --- import kbnCoreTestHelpersHttpSetupBrowserObj from './kbn_core_test_helpers_http_setup_browser.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser.mdx b/api_docs/kbn_core_theme_browser.mdx index ef2002971d8cf..3ceef5f2ae980 100644 --- a/api_docs/kbn_core_theme_browser.mdx +++ b/api_docs/kbn_core_theme_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser title: "@kbn/core-theme-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser'] --- import kbnCoreThemeBrowserObj from './kbn_core_theme_browser.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_internal.mdx b/api_docs/kbn_core_theme_browser_internal.mdx index 670238d870063..f129db97a0ee1 100644 --- a/api_docs/kbn_core_theme_browser_internal.mdx +++ b/api_docs/kbn_core_theme_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-internal title: "@kbn/core-theme-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-internal'] --- import kbnCoreThemeBrowserInternalObj from './kbn_core_theme_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_mocks.mdx b/api_docs/kbn_core_theme_browser_mocks.mdx index 27384fa9a3cda..4ab1c0d6d197b 100644 --- a/api_docs/kbn_core_theme_browser_mocks.mdx +++ b/api_docs/kbn_core_theme_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-mocks title: "@kbn/core-theme-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-mocks'] --- import kbnCoreThemeBrowserMocksObj from './kbn_core_theme_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser.mdx b/api_docs/kbn_core_ui_settings_browser.mdx index 81a75acee1976..ff772b30e2800 100644 --- a/api_docs/kbn_core_ui_settings_browser.mdx +++ b/api_docs/kbn_core_ui_settings_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser title: "@kbn/core-ui-settings-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser'] --- import kbnCoreUiSettingsBrowserObj from './kbn_core_ui_settings_browser.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_internal.mdx b/api_docs/kbn_core_ui_settings_browser_internal.mdx index dbe2442757e47..7e9505349b993 100644 --- a/api_docs/kbn_core_ui_settings_browser_internal.mdx +++ b/api_docs/kbn_core_ui_settings_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-internal title: "@kbn/core-ui-settings-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-internal plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-internal'] --- import kbnCoreUiSettingsBrowserInternalObj from './kbn_core_ui_settings_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_mocks.mdx b/api_docs/kbn_core_ui_settings_browser_mocks.mdx index d97b005399cb3..11e9573e6c278 100644 --- a/api_docs/kbn_core_ui_settings_browser_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-mocks title: "@kbn/core-ui-settings-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-mocks'] --- import kbnCoreUiSettingsBrowserMocksObj from './kbn_core_ui_settings_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_common.devdocs.json b/api_docs/kbn_core_ui_settings_common.devdocs.json index 79bf435bbcb51..f74eb88611721 100644 --- a/api_docs/kbn_core_ui_settings_common.devdocs.json +++ b/api_docs/kbn_core_ui_settings_common.devdocs.json @@ -382,7 +382,7 @@ "section": "def-common.UiSettingsType", "text": "UiSettingsType" }, - " | undefined; metric?: { type: string; name: string; } | undefined; name?: string | undefined; order?: number | undefined; value?: unknown; description?: string | undefined; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", + " | undefined; metric?: { type: string; name: string; } | undefined; value?: unknown; description?: string | undefined; name?: string | undefined; order?: number | undefined; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", { "pluginId": "@kbn/core-ui-settings-common", "scope": "common", diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index 5d9c0f40663fb..46254f0b1bf88 100644 --- a/api_docs/kbn_core_ui_settings_common.mdx +++ b/api_docs/kbn_core_ui_settings_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-common title: "@kbn/core-ui-settings-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-common plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-common'] --- import kbnCoreUiSettingsCommonObj from './kbn_core_ui_settings_common.devdocs.json'; diff --git a/api_docs/kbn_crypto.mdx b/api_docs/kbn_crypto.mdx index 72220648c46af..a4d25e4a8b4c8 100644 --- a/api_docs/kbn_crypto.mdx +++ b/api_docs/kbn_crypto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto title: "@kbn/crypto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto'] --- import kbnCryptoObj from './kbn_crypto.devdocs.json'; diff --git a/api_docs/kbn_crypto_browser.mdx b/api_docs/kbn_crypto_browser.mdx index 0779097e1f512..408632e20e955 100644 --- a/api_docs/kbn_crypto_browser.mdx +++ b/api_docs/kbn_crypto_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto-browser title: "@kbn/crypto-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto-browser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] --- import kbnCryptoBrowserObj from './kbn_crypto_browser.devdocs.json'; diff --git a/api_docs/kbn_datemath.devdocs.json b/api_docs/kbn_datemath.devdocs.json index fc0a5027ecb5b..d3d0d4282c053 100644 --- a/api_docs/kbn_datemath.devdocs.json +++ b/api_docs/kbn_datemath.devdocs.json @@ -105,7 +105,7 @@ "label": "Unit", "description": [], "signature": [ - "\"d\" | \"y\" | \"s\" | \"m\" | \"M\" | \"w\" | \"h\" | \"ms\"" + "\"y\" | \"M\" | \"w\" | \"d\" | \"h\" | \"m\" | \"s\" | \"ms\"" ], "path": "packages/kbn-datemath/src/index.ts", "deprecated": false, @@ -182,7 +182,7 @@ "label": "UnitsMap", "description": [], "signature": [ - "{ d: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; y: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; s: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; m: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; M: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; w: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; h: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; ms: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; }" + "{ y: { weight: number; type: \"fixed\" | \"calendar\" | \"mixed\"; base: number; }; M: { weight: number; type: \"fixed\" | \"calendar\" | \"mixed\"; base: number; }; w: { weight: number; type: \"fixed\" | \"calendar\" | \"mixed\"; base: number; }; d: { weight: number; type: \"fixed\" | \"calendar\" | \"mixed\"; base: number; }; h: { weight: number; type: \"fixed\" | \"calendar\" | \"mixed\"; base: number; }; m: { weight: number; type: \"fixed\" | \"calendar\" | \"mixed\"; base: number; }; s: { weight: number; type: \"fixed\" | \"calendar\" | \"mixed\"; base: number; }; ms: { weight: number; type: \"fixed\" | \"calendar\" | \"mixed\"; base: number; }; }" ], "path": "packages/kbn-datemath/src/index.ts", "deprecated": false, diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index eb8a26a2e6b14..ee1c7e6da162d 100644 --- a/api_docs/kbn_datemath.mdx +++ b/api_docs/kbn_datemath.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-datemath title: "@kbn/datemath" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/datemath plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/datemath'] --- import kbnDatemathObj from './kbn_datemath.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_errors.mdx b/api_docs/kbn_dev_cli_errors.mdx index dac854ad5f225..631777f17b197 100644 --- a/api_docs/kbn_dev_cli_errors.mdx +++ b/api_docs/kbn_dev_cli_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-errors title: "@kbn/dev-cli-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-errors plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-errors'] --- import kbnDevCliErrorsObj from './kbn_dev_cli_errors.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index de11bc7dcec7a..5a6ad81b8429f 100644 --- a/api_docs/kbn_dev_cli_runner.mdx +++ b/api_docs/kbn_dev_cli_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-runner title: "@kbn/dev-cli-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-runner plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-runner'] --- import kbnDevCliRunnerObj from './kbn_dev_cli_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_proc_runner.mdx b/api_docs/kbn_dev_proc_runner.mdx index c0db209b386a3..11fd31b384525 100644 --- a/api_docs/kbn_dev_proc_runner.mdx +++ b/api_docs/kbn_dev_proc_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-proc-runner title: "@kbn/dev-proc-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-proc-runner plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-proc-runner'] --- import kbnDevProcRunnerObj from './kbn_dev_proc_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_utils.mdx b/api_docs/kbn_dev_utils.mdx index f17c60d38a638..0b6849df60e53 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-utils title: "@kbn/dev-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] --- import kbnDevUtilsObj from './kbn_dev_utils.devdocs.json'; diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index 09486ed64f008..e74eb3586fedd 100644 --- a/api_docs/kbn_doc_links.mdx +++ b/api_docs/kbn_doc_links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-doc-links title: "@kbn/doc-links" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/doc-links plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/doc-links'] --- import kbnDocLinksObj from './kbn_doc_links.devdocs.json'; diff --git a/api_docs/kbn_docs_utils.mdx b/api_docs/kbn_docs_utils.mdx index 88f4507bbf3e7..9d1b0938ee6d6 100644 --- a/api_docs/kbn_docs_utils.mdx +++ b/api_docs/kbn_docs_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-docs-utils title: "@kbn/docs-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/docs-utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] --- import kbnDocsUtilsObj from './kbn_docs_utils.devdocs.json'; diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index 0079234ab0bee..39e29add11f4f 100644 --- a/api_docs/kbn_ebt_tools.mdx +++ b/api_docs/kbn_ebt_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ebt-tools title: "@kbn/ebt-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ebt-tools plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.devdocs.json'; diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index 245934b95f96c..788c2df268e17 100644 --- a/api_docs/kbn_es_archiver.mdx +++ b/api_docs/kbn_es_archiver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-archiver title: "@kbn/es-archiver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-archiver plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-archiver'] --- import kbnEsArchiverObj from './kbn_es_archiver.devdocs.json'; diff --git a/api_docs/kbn_es_errors.mdx b/api_docs/kbn_es_errors.mdx index 368a7e844a6bc..77a248212ec42 100644 --- a/api_docs/kbn_es_errors.mdx +++ b/api_docs/kbn_es_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-errors title: "@kbn/es-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-errors plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-errors'] --- import kbnEsErrorsObj from './kbn_es_errors.devdocs.json'; diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index 8cdc2572e99c0..a8fd39203679c 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-query title: "@kbn/es-query" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-query plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] --- import kbnEsQueryObj from './kbn_es_query.devdocs.json'; diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index 4c2857c9d21ed..058e9ecc01944 100644 --- a/api_docs/kbn_eslint_plugin_imports.mdx +++ b/api_docs/kbn_eslint_plugin_imports.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-eslint-plugin-imports title: "@kbn/eslint-plugin-imports" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/eslint-plugin-imports plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] --- import kbnEslintPluginImportsObj from './kbn_eslint_plugin_imports.devdocs.json'; diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index 171e1d101e7d5..7ad02c8a4e21f 100644 --- a/api_docs/kbn_field_types.mdx +++ b/api_docs/kbn_field_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-types title: "@kbn/field-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-types plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] --- import kbnFieldTypesObj from './kbn_field_types.devdocs.json'; diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index f2a6eef8ce415..c36a31b3f3b1b 100644 --- a/api_docs/kbn_find_used_node_modules.mdx +++ b/api_docs/kbn_find_used_node_modules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-find-used-node-modules title: "@kbn/find-used-node-modules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/find-used-node-modules plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/find-used-node-modules'] --- import kbnFindUsedNodeModulesObj from './kbn_find_used_node_modules.devdocs.json'; diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index 62ec39d5a32fd..3693f9483dad8 100644 --- a/api_docs/kbn_generate.mdx +++ b/api_docs/kbn_generate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate title: "@kbn/generate" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate'] --- import kbnGenerateObj from './kbn_generate.devdocs.json'; diff --git a/api_docs/kbn_get_repo_files.mdx b/api_docs/kbn_get_repo_files.mdx index 5b379695b62f4..30029d0ee9a86 100644 --- a/api_docs/kbn_get_repo_files.mdx +++ b/api_docs/kbn_get_repo_files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-get-repo-files title: "@kbn/get-repo-files" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/get-repo-files plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/get-repo-files'] --- import kbnGetRepoFilesObj from './kbn_get_repo_files.devdocs.json'; diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx index d49f4b11a6af6..72e64e4308db3 100644 --- a/api_docs/kbn_handlebars.mdx +++ b/api_docs/kbn_handlebars.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-handlebars title: "@kbn/handlebars" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/handlebars plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/handlebars'] --- import kbnHandlebarsObj from './kbn_handlebars.devdocs.json'; diff --git a/api_docs/kbn_hapi_mocks.mdx b/api_docs/kbn_hapi_mocks.mdx index caa91215361dd..f93a8dde44505 100644 --- a/api_docs/kbn_hapi_mocks.mdx +++ b/api_docs/kbn_hapi_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-hapi-mocks title: "@kbn/hapi-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/hapi-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/hapi-mocks'] --- import kbnHapiMocksObj from './kbn_hapi_mocks.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_card.devdocs.json b/api_docs/kbn_home_sample_data_card.devdocs.json index 4297b7ded9eb5..1806b7c0a813f 100644 --- a/api_docs/kbn_home_sample_data_card.devdocs.json +++ b/api_docs/kbn_home_sample_data_card.devdocs.json @@ -602,7 +602,7 @@ "\nParameters drawn from the Storybook arguments collection that customize a component story." ], "signature": [ - "{ status: any; name: any; description: any; includeAppLinks: any; simulateErrors: any; }" + "{ status: any; description: any; name: any; includeAppLinks: any; simulateErrors: any; }" ], "path": "packages/home/sample_data_card/src/mocks/index.ts", "deprecated": false, diff --git a/api_docs/kbn_home_sample_data_card.mdx b/api_docs/kbn_home_sample_data_card.mdx index 0677e66b39b94..85c912e2ed9bb 100644 --- a/api_docs/kbn_home_sample_data_card.mdx +++ b/api_docs/kbn_home_sample_data_card.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-card title: "@kbn/home-sample-data-card" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-card plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-card'] --- import kbnHomeSampleDataCardObj from './kbn_home_sample_data_card.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_tab.mdx b/api_docs/kbn_home_sample_data_tab.mdx index 7fc10bb39c7e5..b2087c8fb2dec 100644 --- a/api_docs/kbn_home_sample_data_tab.mdx +++ b/api_docs/kbn_home_sample_data_tab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-tab title: "@kbn/home-sample-data-tab" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-tab plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-tab'] --- import kbnHomeSampleDataTabObj from './kbn_home_sample_data_tab.devdocs.json'; diff --git a/api_docs/kbn_i18n.mdx b/api_docs/kbn_i18n.mdx index e28b1cb974bf0..adcf719e448d0 100644 --- a/api_docs/kbn_i18n.mdx +++ b/api_docs/kbn_i18n.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n title: "@kbn/i18n" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] --- import kbnI18nObj from './kbn_i18n.devdocs.json'; diff --git a/api_docs/kbn_import_resolver.mdx b/api_docs/kbn_import_resolver.mdx index 84ba83106ac49..dce6cdc231d25 100644 --- a/api_docs/kbn_import_resolver.mdx +++ b/api_docs/kbn_import_resolver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-import-resolver title: "@kbn/import-resolver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/import-resolver plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] --- import kbnImportResolverObj from './kbn_import_resolver.devdocs.json'; diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index 0e5c3eadee95d..e9d43c221a946 100644 --- a/api_docs/kbn_interpreter.mdx +++ b/api_docs/kbn_interpreter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-interpreter title: "@kbn/interpreter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/interpreter plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] --- import kbnInterpreterObj from './kbn_interpreter.devdocs.json'; diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index 4d0df4ad00472..a2f38e4ff55b9 100644 --- a/api_docs/kbn_io_ts_utils.mdx +++ b/api_docs/kbn_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-io-ts-utils title: "@kbn/io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/io-ts-utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] --- import kbnIoTsUtilsObj from './kbn_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index 7bac123b1babd..18110d36bb618 100644 --- a/api_docs/kbn_jest_serializers.mdx +++ b/api_docs/kbn_jest_serializers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-jest-serializers title: "@kbn/jest-serializers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/jest-serializers plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] --- import kbnJestSerializersObj from './kbn_jest_serializers.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_parser.mdx b/api_docs/kbn_kibana_manifest_parser.mdx index bd4e073bef1a5..23a8d98b75658 100644 --- a/api_docs/kbn_kibana_manifest_parser.mdx +++ b/api_docs/kbn_kibana_manifest_parser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-manifest-parser title: "@kbn/kibana-manifest-parser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/kibana-manifest-parser plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-manifest-parser'] --- import kbnKibanaManifestParserObj from './kbn_kibana_manifest_parser.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_schema.mdx b/api_docs/kbn_kibana_manifest_schema.mdx index bd6c0bb4dd0b8..4b2c19e02107b 100644 --- a/api_docs/kbn_kibana_manifest_schema.mdx +++ b/api_docs/kbn_kibana_manifest_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-manifest-schema title: "@kbn/kibana-manifest-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/kibana-manifest-schema plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-manifest-schema'] --- import kbnKibanaManifestSchemaObj from './kbn_kibana_manifest_schema.devdocs.json'; diff --git a/api_docs/kbn_logging.devdocs.json b/api_docs/kbn_logging.devdocs.json index fbd76bba91bab..33bcbcb329f08 100644 --- a/api_docs/kbn_logging.devdocs.json +++ b/api_docs/kbn_logging.devdocs.json @@ -660,7 +660,7 @@ "label": "EcsEventType", "description": [], "signature": [ - "\"start\" | \"error\" | \"connection\" | \"end\" | \"group\" | \"user\" | \"info\" | \"admin\" | \"protocol\" | \"access\" | \"allowed\" | \"change\" | \"creation\" | \"deletion\" | \"denied\" | \"installation\"" + "\"start\" | \"error\" | \"connection\" | \"user\" | \"info\" | \"group\" | \"end\" | \"admin\" | \"protocol\" | \"access\" | \"allowed\" | \"change\" | \"creation\" | \"deletion\" | \"denied\" | \"installation\"" ], "path": "packages/kbn-logging/src/ecs/event.ts", "deprecated": false, diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index c3bdb83c8c4c0..398abe38c8108 100644 --- a/api_docs/kbn_logging.mdx +++ b/api_docs/kbn_logging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging title: "@kbn/logging" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] --- import kbnLoggingObj from './kbn_logging.devdocs.json'; diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index 2116389d6b4a2..e94ecfd698cd0 100644 --- a/api_docs/kbn_logging_mocks.mdx +++ b/api_docs/kbn_logging_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging-mocks title: "@kbn/logging-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] --- import kbnLoggingMocksObj from './kbn_logging_mocks.devdocs.json'; diff --git a/api_docs/kbn_managed_vscode_config.mdx b/api_docs/kbn_managed_vscode_config.mdx index 047d8f557b40d..e3beeafc537f3 100644 --- a/api_docs/kbn_managed_vscode_config.mdx +++ b/api_docs/kbn_managed_vscode_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-managed-vscode-config title: "@kbn/managed-vscode-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/managed-vscode-config plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-vscode-config'] --- import kbnManagedVscodeConfigObj from './kbn_managed_vscode_config.devdocs.json'; diff --git a/api_docs/kbn_mapbox_gl.devdocs.json b/api_docs/kbn_mapbox_gl.devdocs.json index be7808b1047d2..c620f401dd1fe 100644 --- a/api_docs/kbn_mapbox_gl.devdocs.json +++ b/api_docs/kbn_mapbox_gl.devdocs.json @@ -8105,7 +8105,7 @@ "label": "MapEvent", "description": [], "signature": [ - "\"error\" | \"rotate\" | \"move\" | \"render\" | \"data\" | \"remove\" | \"idle\" | \"resize\" | \"zoom\" | \"mousedown\" | \"mouseup\" | \"mouseover\" | \"mousemove\" | \"click\" | \"dblclick\" | \"mouseenter\" | \"mouseleave\" | \"mouseout\" | \"contextmenu\" | \"wheel\" | \"touchstart\" | \"touchend\" | \"touchmove\" | \"touchcancel\" | \"movestart\" | \"moveend\" | \"dragstart\" | \"drag\" | \"dragend\" | \"zoomstart\" | \"zoomend\" | \"rotatestart\" | \"rotateend\" | \"pitchstart\" | \"pitch\" | \"pitchend\" | \"boxzoomstart\" | \"boxzoomend\" | \"boxzoomcancel\" | \"webglcontextlost\" | \"webglcontextrestored\" | \"load\" | \"styledata\" | \"sourcedata\" | \"dataloading\" | \"styledataloading\" | \"sourcedataloading\" | \"styleimagemissing\" | \"style.load\" | \"dataabort\" | \"sourcedataabort\"" + "\"error\" | \"render\" | \"data\" | \"remove\" | \"rotate\" | \"move\" | \"idle\" | \"resize\" | \"zoom\" | \"mousedown\" | \"mouseup\" | \"mouseover\" | \"mousemove\" | \"click\" | \"dblclick\" | \"mouseenter\" | \"mouseleave\" | \"mouseout\" | \"contextmenu\" | \"wheel\" | \"touchstart\" | \"touchend\" | \"touchmove\" | \"touchcancel\" | \"movestart\" | \"moveend\" | \"dragstart\" | \"drag\" | \"dragend\" | \"zoomstart\" | \"zoomend\" | \"rotatestart\" | \"rotateend\" | \"pitchstart\" | \"pitch\" | \"pitchend\" | \"boxzoomstart\" | \"boxzoomend\" | \"boxzoomcancel\" | \"webglcontextlost\" | \"webglcontextrestored\" | \"load\" | \"styledata\" | \"sourcedata\" | \"dataloading\" | \"styledataloading\" | \"sourcedataloading\" | \"styleimagemissing\" | \"style.load\" | \"dataabort\" | \"sourcedataabort\"" ], "path": "node_modules/maplibre-gl/dist/maplibre-gl.d.ts", "deprecated": false, diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index 16860f49c08b1..c79bec946fc29 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-mapbox-gl title: "@kbn/mapbox-gl" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/mapbox-gl plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] --- import kbnMapboxGlObj from './kbn_mapbox_gl.devdocs.json'; diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index dc297a195df14..c7c5da659639a 100644 --- a/api_docs/kbn_ml_agg_utils.mdx +++ b/api_docs/kbn_ml_agg_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-agg-utils title: "@kbn/ml-agg-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-agg-utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] --- import kbnMlAggUtilsObj from './kbn_ml_agg_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_is_populated_object.mdx b/api_docs/kbn_ml_is_populated_object.mdx index cd44e2469a2d1..7401adc69b2d3 100644 --- a/api_docs/kbn_ml_is_populated_object.mdx +++ b/api_docs/kbn_ml_is_populated_object.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-populated-object title: "@kbn/ml-is-populated-object" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-populated-object plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-populated-object'] --- import kbnMlIsPopulatedObjectObj from './kbn_ml_is_populated_object.devdocs.json'; diff --git a/api_docs/kbn_ml_string_hash.mdx b/api_docs/kbn_ml_string_hash.mdx index 77a51ea6e2e92..a8afb7fccc9b0 100644 --- a/api_docs/kbn_ml_string_hash.mdx +++ b/api_docs/kbn_ml_string_hash.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-string-hash title: "@kbn/ml-string-hash" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-string-hash plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-string-hash'] --- import kbnMlStringHashObj from './kbn_ml_string_hash.devdocs.json'; diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index eaf6d7999e731..14b455dacc247 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-monaco title: "@kbn/monaco" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/monaco plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index 538607cf9fe63..93f1843422007 100644 --- a/api_docs/kbn_optimizer.mdx +++ b/api_docs/kbn_optimizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer title: "@kbn/optimizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer'] --- import kbnOptimizerObj from './kbn_optimizer.devdocs.json'; diff --git a/api_docs/kbn_optimizer_webpack_helpers.mdx b/api_docs/kbn_optimizer_webpack_helpers.mdx index 0316bedca365b..a8f9f5b35d016 100644 --- a/api_docs/kbn_optimizer_webpack_helpers.mdx +++ b/api_docs/kbn_optimizer_webpack_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer-webpack-helpers title: "@kbn/optimizer-webpack-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer-webpack-helpers plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer-webpack-helpers'] --- import kbnOptimizerWebpackHelpersObj from './kbn_optimizer_webpack_helpers.devdocs.json'; diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index 13e841b5fe6da..a5308ba6c163b 100644 --- a/api_docs/kbn_performance_testing_dataset_extractor.mdx +++ b/api_docs/kbn_performance_testing_dataset_extractor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-performance-testing-dataset-extractor title: "@kbn/performance-testing-dataset-extractor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/performance-testing-dataset-extractor plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/performance-testing-dataset-extractor'] --- import kbnPerformanceTestingDatasetExtractorObj from './kbn_performance_testing_dataset_extractor.devdocs.json'; diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index f189d7c0def9a..28beacfc3f693 100644 --- a/api_docs/kbn_plugin_generator.mdx +++ b/api_docs/kbn_plugin_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-generator title: "@kbn/plugin-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-generator plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-generator'] --- import kbnPluginGeneratorObj from './kbn_plugin_generator.devdocs.json'; diff --git a/api_docs/kbn_plugin_helpers.mdx b/api_docs/kbn_plugin_helpers.mdx index 7fcb594feb85f..7beb778393c92 100644 --- a/api_docs/kbn_plugin_helpers.mdx +++ b/api_docs/kbn_plugin_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-helpers title: "@kbn/plugin-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-helpers plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] --- import kbnPluginHelpersObj from './kbn_plugin_helpers.devdocs.json'; diff --git a/api_docs/kbn_react_field.devdocs.json b/api_docs/kbn_react_field.devdocs.json index 64ce7f66c3796..009157238dbe8 100644 --- a/api_docs/kbn_react_field.devdocs.json +++ b/api_docs/kbn_react_field.devdocs.json @@ -233,7 +233,7 @@ "\nUse the small size in condensed areas" ], "signature": [ - "\"s\" | \"m\" | undefined" + "\"m\" | \"s\" | undefined" ], "path": "packages/kbn-react-field/src/field_button/field_button.tsx", "deprecated": false @@ -375,7 +375,7 @@ "label": "ButtonSize", "description": [], "signature": [ - "\"s\" | \"m\"" + "\"m\" | \"s\"" ], "path": "packages/kbn-react-field/src/field_button/field_button.tsx", "deprecated": false, diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index 535872f9ff6b9..9b5d69a2a3fc9 100644 --- a/api_docs/kbn_react_field.mdx +++ b/api_docs/kbn_react_field.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-field title: "@kbn/react-field" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-field plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] --- import kbnReactFieldObj from './kbn_react_field.devdocs.json'; diff --git a/api_docs/kbn_repo_source_classifier.mdx b/api_docs/kbn_repo_source_classifier.mdx index 59937e2c814a1..ab394175f6a0f 100644 --- a/api_docs/kbn_repo_source_classifier.mdx +++ b/api_docs/kbn_repo_source_classifier.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-source-classifier title: "@kbn/repo-source-classifier" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-source-classifier plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-source-classifier'] --- import kbnRepoSourceClassifierObj from './kbn_repo_source_classifier.devdocs.json'; diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index f581679de9f7e..0891519c809c3 100644 --- a/api_docs/kbn_rule_data_utils.mdx +++ b/api_docs/kbn_rule_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rule-data-utils title: "@kbn/rule-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rule-data-utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] --- import kbnRuleDataUtilsObj from './kbn_rule_data_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_autocomplete.devdocs.json b/api_docs/kbn_securitysolution_autocomplete.devdocs.json index 9b398cf6f6c7d..a510ecf234a9e 100644 --- a/api_docs/kbn_securitysolution_autocomplete.devdocs.json +++ b/api_docs/kbn_securitysolution_autocomplete.devdocs.json @@ -305,9 +305,9 @@ "\nGiven an array of lists and optionally a field this will return all\nthe lists that match against the field based on the types from the field\n\nNOTE: That we support one additional property from \"FieldSpec\" located here:\nsrc/plugins/data/common/index_patterns/fields/types.ts\nThis type property is esTypes. If it exists and is on there we will read off the esTypes." ], "signature": [ - "(lists: { _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[], field?: (", + "(lists: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[], field?: (", "DataViewFieldBase", - " & { esTypes?: string[] | undefined; }) | undefined) => { _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]" + " & { esTypes?: string[] | undefined; }) | undefined) => { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]" ], "path": "packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.ts", "deprecated": false, @@ -322,7 +322,7 @@ "The lists to match against the field" ], "signature": [ - "{ _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]" + "{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]" ], "path": "packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.ts", "deprecated": false, diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index d32afd6771f7c..03a3328c1e9f0 100644 --- a/api_docs/kbn_securitysolution_autocomplete.mdx +++ b/api_docs/kbn_securitysolution_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-autocomplete title: "@kbn/securitysolution-autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-autocomplete plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] --- import kbnSecuritysolutionAutocompleteObj from './kbn_securitysolution_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_es_utils.devdocs.json b/api_docs/kbn_securitysolution_es_utils.devdocs.json index 691d22e6d89ad..821e948cf359b 100644 --- a/api_docs/kbn_securitysolution_es_utils.devdocs.json +++ b/api_docs/kbn_securitysolution_es_utils.devdocs.json @@ -487,7 +487,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -555,7 +553,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -1563,6 +1561,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -1729,7 +1729,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -1797,7 +1795,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -2805,6 +2803,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index e3ffa1e98994e..d141725ac9a0c 100644 --- a/api_docs/kbn_securitysolution_es_utils.mdx +++ b/api_docs/kbn_securitysolution_es_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-es-utils title: "@kbn/securitysolution-es-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-es-utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] --- import kbnSecuritysolutionEsUtilsObj from './kbn_securitysolution_es_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index e16e7aeb837c1..ba328a7473dce 100644 --- a/api_docs/kbn_securitysolution_hook_utils.mdx +++ b/api_docs/kbn_securitysolution_hook_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-hook-utils title: "@kbn/securitysolution-hook-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-hook-utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-hook-utils'] --- import kbnSecuritysolutionHookUtilsObj from './kbn_securitysolution_hook_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx index 9c159d2c86ec9..24e94179a47e3 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-alerting-types title: "@kbn/securitysolution-io-ts-alerting-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-alerting-types plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-alerting-types'] --- import kbnSecuritysolutionIoTsAlertingTypesObj from './kbn_securitysolution_io_ts_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.devdocs.json b/api_docs/kbn_securitysolution_io_ts_list_types.devdocs.json index d70b0afdf481c..5261280f27b3f 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.devdocs.json +++ b/api_docs/kbn_securitysolution_io_ts_list_types.devdocs.json @@ -27,7 +27,7 @@ "label": "updateExceptionListItemValidate", "description": [], "signature": [ - "(schema: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => string[]" + "(schema: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => string[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_validation/index.ts", "deprecated": false, @@ -40,7 +40,7 @@ "label": "schema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_validation/index.ts", "deprecated": false, @@ -58,7 +58,7 @@ "label": "validateComments", "description": [], "signature": [ - "(item: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => string[]" + "(item: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => string[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_validation/index.ts", "deprecated": false, @@ -71,7 +71,7 @@ "label": "item", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_validation/index.ts", "deprecated": false, @@ -153,7 +153,7 @@ "label": "listItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false @@ -1216,7 +1216,7 @@ "label": "listItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false @@ -1307,7 +1307,7 @@ "label": "exceptions", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false @@ -1897,7 +1897,7 @@ "label": "CreateEndpointListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; meta: object | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"os_types\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; meta: object | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"os_types\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.ts", "deprecated": false, @@ -1925,7 +1925,7 @@ "label": "CreateExceptionListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.ts", "deprecated": false, @@ -1939,7 +1939,7 @@ "label": "CreateExceptionListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.ts", "deprecated": false, @@ -2009,7 +2009,7 @@ "label": "CreateListSchema", "description": [], "signature": [ - "{ description: string; name: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; } & { deserializer?: string | undefined; id?: string | undefined; meta?: object | undefined; serializer?: string | undefined; version?: number | undefined; }" + "{ description: string; name: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; } & { deserializer?: string | undefined; id?: string | undefined; meta?: object | undefined; serializer?: string | undefined; version?: number | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.ts", "deprecated": false, @@ -2023,7 +2023,7 @@ "label": "CreateListSchemaDecoded", "description": [], "signature": [ - "{ type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; id: string | undefined; name: string; description: string; meta: object | undefined; serializer: string | undefined; deserializer: string | undefined; } & { version: number; }" + "{ type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; id: string | undefined; description: string; name: string; meta: object | undefined; serializer: string | undefined; deserializer: string | undefined; } & { version: number; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.ts", "deprecated": false, @@ -2317,7 +2317,7 @@ "label": "EntriesArray", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts", "deprecated": false, @@ -2331,7 +2331,7 @@ "label": "EntriesArrayOrUndefined", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[] | undefined" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[] | undefined" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts", "deprecated": false, @@ -2345,7 +2345,7 @@ "label": "Entry", "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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }" + "{ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts", "deprecated": false, @@ -2373,7 +2373,7 @@ "label": "EntryList", "description": [], "signature": [ - "{ field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; }" + "{ field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.ts", "deprecated": false, @@ -2443,7 +2443,7 @@ "label": "ExceptionListItemSchema", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.ts", "deprecated": false, @@ -2765,7 +2765,7 @@ "label": "FoundExceptionListItemSchema", "description": [], "signature": [ - "{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }" + "{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.ts", "deprecated": false, @@ -2793,7 +2793,7 @@ "label": "FoundListItemSchema", "description": [], "signature": [ - "{ 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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }" + "{ 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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.ts", "deprecated": false, @@ -2807,7 +2807,7 @@ "label": "FoundListSchema", "description": [], "signature": [ - "{ 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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }" + "{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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": "packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.ts", "deprecated": false, @@ -2919,7 +2919,7 @@ "label": "ImportExceptionListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; item_id: string; list_id: string; name: string; type: \"simple\"; } & { id?: string | undefined; comments?: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[] | undefined; created_at?: string | undefined; updated_at?: string | undefined; created_by?: string | undefined; updated_by?: string | undefined; _version?: string | undefined; tie_breaker_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; item_id: string; list_id: string; name: string; type: \"simple\"; } & { id?: string | undefined; comments?: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[] | undefined; created_at?: string | undefined; updated_at?: string | undefined; created_by?: string | undefined; updated_by?: string | undefined; _version?: string | undefined; tie_breaker_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.ts", "deprecated": false, @@ -2933,7 +2933,7 @@ "label": "ImportExceptionListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; item_id: string; list_id: string; name: string; type: \"simple\"; } & { id?: string | undefined; comments?: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[] | undefined; created_at?: string | undefined; updated_at?: string | undefined; created_by?: string | undefined; updated_by?: string | undefined; _version?: string | undefined; tie_breaker_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; item_id: string; list_id: string; name: string; type: \"simple\"; } & { id?: string | undefined; comments?: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[] | undefined; created_at?: string | undefined; updated_at?: string | undefined; created_by?: string | undefined; updated_by?: string | undefined; _version?: string | undefined; tie_breaker_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.ts", "deprecated": false, @@ -2989,7 +2989,7 @@ "label": "ImportListItemQuerySchema", "description": [], "signature": [ - "{ deserializer: string | undefined; list_id: string | undefined; serializer: string | undefined; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\" | undefined; }" + "{ deserializer: string | undefined; list_id: string | undefined; serializer: string | undefined; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\" | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.ts", "deprecated": false, @@ -3003,7 +3003,7 @@ "label": "ImportListItemQuerySchemaEncoded", "description": [], "signature": [ - "{ deserializer?: string | undefined; list_id?: string | undefined; serializer?: string | undefined; type?: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\" | undefined; }" + "{ deserializer?: string | undefined; list_id?: string | undefined; serializer?: string | undefined; type?: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\" | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.ts", "deprecated": false, @@ -3115,7 +3115,7 @@ "label": "ListArraySchema", "description": [], "signature": [ - "{ _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]" + "{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.ts", "deprecated": false, @@ -3157,7 +3157,7 @@ "label": "ListItemArraySchema", "description": [], "signature": [ - "{ _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]" + "{ _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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.ts", "deprecated": false, @@ -3185,7 +3185,7 @@ "label": "ListItemSchema", "description": [], "signature": [ - "{ _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }" + "{ _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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.ts", "deprecated": false, @@ -3213,7 +3213,7 @@ "label": "ListSchema", "description": [], "signature": [ - "{ _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }" + "{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.ts", "deprecated": false, @@ -3423,7 +3423,7 @@ "label": "NonEmptyEntriesArray", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts", "deprecated": false, @@ -3437,7 +3437,7 @@ "label": "NonEmptyEntriesArrayDecoded", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts", "deprecated": false, @@ -3829,7 +3829,7 @@ "label": "SearchListItemArraySchema", "description": [], "signature": [ - "{ 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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }[]" + "{ 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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.ts", "deprecated": false, @@ -3843,7 +3843,7 @@ "label": "SearchListItemSchema", "description": [], "signature": [ - "{ 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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }" + "{ 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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.ts", "deprecated": false, @@ -3983,7 +3983,7 @@ "label": "Type", "description": [], "signature": [ - "\"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"" + "\"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.ts", "deprecated": false, @@ -3997,7 +3997,7 @@ "label": "TypeOrUndefined", "description": [], "signature": [ - "\"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\" | undefined" + "\"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\" | undefined" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.ts", "deprecated": false, @@ -4053,7 +4053,7 @@ "label": "UpdateEndpointListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.ts", "deprecated": false, @@ -4067,7 +4067,7 @@ "label": "UpdateEndpointListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; _version: string | undefined; comments: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id: string | undefined; item_id: string | undefined; meta: object | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\"> & { comments: ({ comment: string; } & { id?: string | undefined; })[]; tags: string[]; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; _version: string | undefined; comments: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id: string | undefined; item_id: string | undefined; meta: object | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\"> & { comments: ({ comment: string; } & { id?: string | undefined; })[]; tags: string[]; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.ts", "deprecated": false, @@ -4081,7 +4081,7 @@ "label": "UpdateExceptionListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.ts", "deprecated": false, @@ -4095,7 +4095,7 @@ "label": "UpdateExceptionListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; _version: string | undefined; comments: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id: string | undefined; item_id: string | undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"namespace_type\" | \"os_types\"> & { comments: ({ comment: string; } & { id?: string | undefined; })[]; tags: string[]; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; _version: string | undefined; comments: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id: string | undefined; item_id: string | undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"namespace_type\" | \"os_types\"> & { comments: ({ comment: string; } & { id?: string | undefined; })[]; tags: string[]; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.ts", "deprecated": false, @@ -4628,7 +4628,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; list_id: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; list_id: ", "Type", "; name: ", "StringC", @@ -6914,7 +6914,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; item_id: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; item_id: ", "Type", "; list_id: ", "Type", @@ -7847,7 +7847,7 @@ ], "signature": [ "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>" + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts", "deprecated": false, @@ -8780,7 +8780,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; name: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; name: ", "StringC", "; type: ", "KeyofC", @@ -8833,7 +8833,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; name: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; name: ", "StringC", "; type: ", "KeyofC", diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index 07306ec770a6e..3a34e61699c34 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_list_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-list-types title: "@kbn/securitysolution-io-ts-list-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-list-types plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-list-types'] --- import kbnSecuritysolutionIoTsListTypesObj from './kbn_securitysolution_io_ts_list_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_types.mdx b/api_docs/kbn_securitysolution_io_ts_types.mdx index 607f134f0a841..4ff0ce7e6062c 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-types title: "@kbn/securitysolution-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-types plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-types'] --- import kbnSecuritysolutionIoTsTypesObj from './kbn_securitysolution_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_utils.mdx b/api_docs/kbn_securitysolution_io_ts_utils.mdx index 0f3c78e8aa6c5..6eaadbb34e667 100644 --- a/api_docs/kbn_securitysolution_io_ts_utils.mdx +++ b/api_docs/kbn_securitysolution_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-utils title: "@kbn/securitysolution-io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-utils'] --- import kbnSecuritysolutionIoTsUtilsObj from './kbn_securitysolution_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_api.devdocs.json b/api_docs/kbn_securitysolution_list_api.devdocs.json index 3acfb1f169401..53a9d300892b8 100644 --- a/api_docs/kbn_securitysolution_list_api.devdocs.json +++ b/api_docs/kbn_securitysolution_list_api.devdocs.json @@ -62,7 +62,7 @@ "signature": [ "({ http, listItem, signal, }: ", "AddExceptionListItemProps", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -206,7 +206,7 @@ "signature": [ "({ http, id, namespaceType, signal, }: ", "ApiCallByIdProps", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -245,7 +245,7 @@ "section": "def-common.DeleteListParams", "text": "DeleteListParams" }, - ") => 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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-list-api/src/list_api/index.ts", "deprecated": false, @@ -399,7 +399,7 @@ "signature": [ "({ http, id, namespaceType, signal, }: ", "ApiCallByIdProps", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -432,7 +432,7 @@ "signature": [ "({ filterOptions, http, listIds, namespaceTypes, pagination, signal, }: ", "ApiCallByListIdProps", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; } & { pit?: string | undefined; }>" + ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; } & { pit?: string | undefined; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -504,7 +504,7 @@ "section": "def-common.FindListsParams", "text": "FindListsParams" }, - ") => 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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-list-api/src/list_api/index.ts", "deprecated": false, @@ -549,7 +549,7 @@ "section": "def-common.ImportListParams", "text": "ImportListParams" }, - ") => 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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-list-api/src/list_api/index.ts", "deprecated": false, @@ -743,7 +743,7 @@ "signature": [ "({ http, listItem, signal, }: ", "UpdateExceptionListItemProps", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -1102,7 +1102,7 @@ "label": "type", "description": [], "signature": [ - "\"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\" | undefined" + "\"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\" | undefined" ], "path": "packages/kbn-securitysolution-list-api/src/list_api/types.ts", "deprecated": false diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index d29331d3536c9..a0b5b4884014b 100644 --- a/api_docs/kbn_securitysolution_list_api.mdx +++ b/api_docs/kbn_securitysolution_list_api.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-api title: "@kbn/securitysolution-list-api" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-api plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-api'] --- import kbnSecuritysolutionListApiObj from './kbn_securitysolution_list_api.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_constants.mdx b/api_docs/kbn_securitysolution_list_constants.mdx index 7dd62ecf681be..8540740dae243 100644 --- a/api_docs/kbn_securitysolution_list_constants.mdx +++ b/api_docs/kbn_securitysolution_list_constants.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-constants title: "@kbn/securitysolution-list-constants" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-constants plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-constants'] --- import kbnSecuritysolutionListConstantsObj from './kbn_securitysolution_list_constants.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_hooks.devdocs.json b/api_docs/kbn_securitysolution_list_hooks.devdocs.json index cea0783070c18..ad642ef094b12 100644 --- a/api_docs/kbn_securitysolution_list_hooks.devdocs.json +++ b/api_docs/kbn_securitysolution_list_hooks.devdocs.json @@ -29,7 +29,7 @@ "\nThis adds an id to the incoming exception item entries as ReactJS prefers to have\nan id added to them for use as a stable id. Later if we decide to change the data\nmodel to have id's within the array then this code should be removed. If not, then\nthis code should stay as an adapter for ReactJS.\n\nThis does break the type system slightly as we are lying a bit to the type system as we return\nthe same exceptionItem as we have previously but are augmenting the arrays with an id which TypeScript\ndoesn't mind us doing here. However, downstream you will notice that you have an id when the type\ndoes not indicate it. In that case use (ExceptionItem & { id: string }) temporarily if you're using the id. If you're not,\nyou can ignore the id and just use the normal TypeScript with ReactJS.\n" ], "signature": [ - "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }) => { _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }" + "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; }) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -44,7 +44,7 @@ "The exceptionItem to add an id to the threat matches." ], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -66,7 +66,7 @@ "\nThis removes an id from the exceptionItem entries as ReactJS prefers to have\nan id added to them for use as a stable id. Later if we decide to change the data\nmodel to have id's within the array then this code should be removed. If not, then\nthis code should stay as an adapter for ReactJS.\n" ], "signature": [ - "(exceptionItem: T) => T" + "(exceptionItem: T) => T" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -103,7 +103,7 @@ "\nTransforms the output of rules to compensate for technical debt or UI concerns such as\nReactJS preferences for having ids within arrays if the data is not modeled that way.\n\nIf you add a new transform of the input called \"myNewTransform\" do it\nin the form of:\nflow(addIdToExceptionItemEntries, myNewTransform)(exceptionItem)\n" ], "signature": [ - "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }) => { _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }" + "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; }) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -118,7 +118,7 @@ "The exceptionItem to transform the output of" ], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -138,7 +138,7 @@ "label": "transformNewItemOutput", "description": [], "signature": [ - "(exceptionItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "(exceptionItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -151,7 +151,7 @@ "label": "exceptionItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -171,7 +171,7 @@ "\nTransforms the output of exception items to compensate for technical debt or UI concerns such as\nReactJS preferences for having ids within arrays if the data is not modeled that way.\n\nIf you add a new transform of the output called \"myNewTransform\" do it\nin the form of:\nflow(removeIdFromExceptionItemsEntries, myNewTransform)(exceptionItem)\n" ], "signature": [ - "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" + "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -186,7 +186,7 @@ "The exceptionItem to transform the output of" ], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -317,7 +317,7 @@ "OptionalSignalArgs", "<", "DeleteListParams", - ">], { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" + ">], { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.ts", "deprecated": false, @@ -445,7 +445,7 @@ "OptionalSignalArgs", "<", "FindListsParams", - ">], { cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }>" + ">], { cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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": "packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.ts", "deprecated": false, @@ -467,7 +467,7 @@ "OptionalSignalArgs", "<", "ImportListParams", - ">], { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" + ">], { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_import_list/index.ts", "deprecated": false, @@ -623,7 +623,7 @@ "label": "addExceptionListItem", "description": [], "signature": [ - "(arg: { listItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }; }) => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }>" + "(arg: { listItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }; }) => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -646,7 +646,7 @@ "label": "listItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false @@ -664,7 +664,7 @@ "label": "updateExceptionListItem", "description": [], "signature": [ - "(arg: { listItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }; }) => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }>" + "(arg: { listItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }; }) => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -687,7 +687,7 @@ "label": "listItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false @@ -771,7 +771,7 @@ "signature": [ "(arg: ", "ApiCallMemoProps", - " & { onSuccess: (arg: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }) => void; }) => Promise" + " & { onSuccess: (arg: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; }) => void; }) => Promise" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -785,7 +785,7 @@ "description": [], "signature": [ "ApiCallMemoProps", - " & { onSuccess: (arg: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }) => void; }" + " & { onSuccess: (arg: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; }) => void; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -954,7 +954,7 @@ "label": "ReturnExceptionListAndItems", "description": [], "signature": [ - "[boolean, { _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }[], ", + "[boolean, { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; }[], ", "Pagination", ", Func | null]" ], @@ -996,7 +996,7 @@ "label": "ReturnPersistExceptionItem", "description": [], "signature": [ - "[PersistReturnExceptionItem, React.Dispatch<({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | null>]" + "[PersistReturnExceptionItem, React.Dispatch<({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | null>]" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts", "deprecated": false, diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index fc9a824d768d9..e618ef74ac24a 100644 --- a/api_docs/kbn_securitysolution_list_hooks.mdx +++ b/api_docs/kbn_securitysolution_list_hooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-hooks title: "@kbn/securitysolution-list-hooks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-hooks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-hooks'] --- import kbnSecuritysolutionListHooksObj from './kbn_securitysolution_list_hooks.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_utils.devdocs.json b/api_docs/kbn_securitysolution_list_utils.devdocs.json index 000a5f00c264f..056f6248c08a1 100644 --- a/api_docs/kbn_securitysolution_list_utils.devdocs.json +++ b/api_docs/kbn_securitysolution_list_utils.devdocs.json @@ -27,7 +27,7 @@ "label": "addIdToEntries", "description": [], "signature": [ - "(entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; })[]" + "(entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -40,7 +40,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -58,7 +58,7 @@ "label": "buildExceptionFilter", "description": [], "signature": [ - "({ lists, excludeExceptions, chunkSize, alias, }: { lists: ({ _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]; excludeExceptions: boolean; chunkSize: number; alias: string | null; }) => ", + "({ lists, excludeExceptions, chunkSize, alias, }: { lists: ({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]; excludeExceptions: boolean; chunkSize: number; alias: string | null; }) => ", "Filter", " | undefined" ], @@ -83,7 +83,7 @@ "label": "lists", "description": [], "signature": [ - "({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" + "({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" ], "path": "packages/kbn-securitysolution-list-utils/src/build_exception_filter/index.ts", "deprecated": false @@ -741,7 +741,7 @@ "section": "def-common.ExceptionsBuilderExceptionItem", "text": "ExceptionsBuilderExceptionItem" }, - "[]) => ({ _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" + "[]) => ({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -995,7 +995,7 @@ "section": "def-common.FormattedBuilderEntry", "text": "FormattedBuilderEntry" }, - ") => ({ 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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }) & { id?: string | undefined; }" + ") => ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }) & { id?: string | undefined; }" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -1137,7 +1137,7 @@ "section": "def-common.FormattedBuilderEntry", "text": "FormattedBuilderEntry" }, - ", newField: { _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }) => { index: number; updatedEntry: ", + ", newField: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }) => { index: number; updatedEntry: ", { "pluginId": "@kbn/securitysolution-list-utils", "scope": "common", @@ -1182,7 +1182,7 @@ "- newly selected list" ], "signature": [ - "{ _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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }" + "{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -2567,7 +2567,7 @@ "label": "hasLargeValueList", "description": [], "signature": [ - "(entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; })[]) => boolean" + "(entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; })[]) => boolean" ], "path": "packages/kbn-securitysolution-list-utils/src/has_large_value_list/index.ts", "deprecated": false, @@ -2580,7 +2580,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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": "packages/kbn-securitysolution-list-utils/src/has_large_value_list/index.ts", "deprecated": false, @@ -3229,7 +3229,7 @@ "label": "BuilderEntry", "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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }) & { id?: string | undefined; }) | ", + "(({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }) & { id?: string | undefined; }) | ", { "pluginId": "@kbn/securitysolution-list-utils", "scope": "common", @@ -3288,7 +3288,7 @@ "label": "CreateExceptionListItemBuilderSchema", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }, \"meta\" | \"entries\"> & { meta: { temporaryUuid: string; }; entries: ", + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }, \"meta\" | \"entries\"> & { meta: { temporaryUuid: string; }; entries: ", { "pluginId": "@kbn/securitysolution-list-utils", "scope": "common", @@ -3422,7 +3422,7 @@ "label": "ExceptionListItemBuilderSchema", "description": [], "signature": [ - "Omit<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }, \"entries\"> & { entries: ", + "Omit<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; }, \"entries\"> & { entries: ", { "pluginId": "@kbn/securitysolution-list-utils", "scope": "common", diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index cd7e8959a6a1a..4d23c1929544d 100644 --- a/api_docs/kbn_securitysolution_list_utils.mdx +++ b/api_docs/kbn_securitysolution_list_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-utils title: "@kbn/securitysolution-list-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-utils'] --- import kbnSecuritysolutionListUtilsObj from './kbn_securitysolution_list_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_rules.mdx b/api_docs/kbn_securitysolution_rules.mdx index 682e77f0f9df7..a69e09a1ec284 100644 --- a/api_docs/kbn_securitysolution_rules.mdx +++ b/api_docs/kbn_securitysolution_rules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-rules title: "@kbn/securitysolution-rules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-rules plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-rules'] --- import kbnSecuritysolutionRulesObj from './kbn_securitysolution_rules.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_t_grid.mdx b/api_docs/kbn_securitysolution_t_grid.mdx index b6f5b878ab9fb..f3b95a89820d7 100644 --- a/api_docs/kbn_securitysolution_t_grid.mdx +++ b/api_docs/kbn_securitysolution_t_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-t-grid title: "@kbn/securitysolution-t-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-t-grid plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-t-grid'] --- import kbnSecuritysolutionTGridObj from './kbn_securitysolution_t_grid.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_utils.mdx b/api_docs/kbn_securitysolution_utils.mdx index 3666b3a1f9b80..3e61673969d88 100644 --- a/api_docs/kbn_securitysolution_utils.mdx +++ b/api_docs/kbn_securitysolution_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-utils title: "@kbn/securitysolution-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] --- import kbnSecuritysolutionUtilsObj from './kbn_securitysolution_utils.devdocs.json'; diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index 9764cd5546c77..da59db637dad9 100644 --- a/api_docs/kbn_server_http_tools.mdx +++ b/api_docs/kbn_server_http_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-http-tools title: "@kbn/server-http-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-http-tools plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] --- import kbnServerHttpToolsObj from './kbn_server_http_tools.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index 6b513c7a8ba89..7ad5dbbabc86d 100644 --- a/api_docs/kbn_server_route_repository.mdx +++ b/api_docs/kbn_server_route_repository.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository title: "@kbn/server-route-repository" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; diff --git a/api_docs/kbn_shared_svg.mdx b/api_docs/kbn_shared_svg.mdx index 472b05f7afddb..5198f1177290e 100644 --- a/api_docs/kbn_shared_svg.mdx +++ b/api_docs/kbn_shared_svg.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-svg title: "@kbn/shared-svg" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-svg plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-svg'] --- import kbnSharedSvgObj from './kbn_shared_svg.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json index cb248defc411e..7595ab6a2bc3f 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock", + "id": "def-common.StorybookMock", "type": "Class", "tags": [], "label": "StorybookMock", @@ -22,9 +30,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxButtonExitFullScreenMocksPluginApi", - "section": "def-server.StorybookMock", + "section": "def-common.StorybookMock", "text": "StorybookMock" }, " extends ", @@ -40,7 +48,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.propArguments", + "id": "def-common.StorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -50,7 +58,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.propArguments.toggleChrome", + "id": "def-common.StorybookMock.propArguments.toggleChrome", "type": "Object", "tags": [], "label": "toggleChrome", @@ -60,7 +68,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.propArguments.toggleChrome.control", + "id": "def-common.StorybookMock.propArguments.toggleChrome.control", "type": "string", "tags": [], "label": "control", @@ -70,7 +78,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.propArguments.toggleChrome.defaultValue", + "id": "def-common.StorybookMock.propArguments.toggleChrome.defaultValue", "type": "boolean", "tags": [], "label": "defaultValue", @@ -84,7 +92,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.serviceArguments", + "id": "def-common.StorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -95,7 +103,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.dependencies", + "id": "def-common.StorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -108,7 +116,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.getProps", + "id": "def-common.StorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -117,9 +125,9 @@ "(params?: ", { "pluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxButtonExitFullScreenMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, " | undefined) => ", @@ -130,7 +138,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.getProps.$1", + "id": "def-common.StorybookMock.getProps.$1", "type": "Object", "tags": [], "label": "params", @@ -138,9 +146,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxButtonExitFullScreenMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, " | undefined" @@ -154,7 +162,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.getServices", + "id": "def-common.StorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -175,7 +183,7 @@ "functions": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.getKibanaDependenciesMock", + "id": "def-common.getKibanaDependenciesMock", "type": "Function", "tags": [], "label": "getKibanaDependenciesMock", @@ -194,7 +202,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.getServicesMock", + "id": "def-common.getServicesMock", "type": "Function", "tags": [], "label": "getServicesMock", @@ -217,7 +225,7 @@ "misc": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.Params", + "id": "def-common.Params", "type": "Type", "tags": [], "label": "Params", @@ -233,13 +241,5 @@ } ], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx index 45dcae6dbb581..87751ce4f2b75 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen-mocks title: "@kbn/shared-ux-button-exit-full-screen-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen-mocks'] --- import kbnSharedUxButtonExitFullScreenMocksObj from './kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json'; @@ -23,14 +23,14 @@ Contact [Owner missing] for questions regarding this plugin. |-------------------|-----------|------------------------|-----------------| | 13 | 0 | 9 | 0 | -## Server +## Common ### Functions - + ### Classes - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index 9b04076f554e8..5658adf14ad4c 100644 --- a/api_docs/kbn_shared_ux_button_toolbar.mdx +++ b/api_docs/kbn_shared_ux_button_toolbar.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-toolbar title: "@kbn/shared-ux-button-toolbar" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-toolbar plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] --- import kbnSharedUxButtonToolbarObj from './kbn_shared_ux_button_toolbar.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data.devdocs.json b/api_docs/kbn_shared_ux_card_no_data.devdocs.json index 5bd520c2260b5..480849c369f6b 100644 --- a/api_docs/kbn_shared_ux_card_no_data.devdocs.json +++ b/api_docs/kbn_shared_ux_card_no_data.devdocs.json @@ -142,7 +142,7 @@ "signature": [ "Partial> & { button?: React.ReactNode; onClick?: React.MouseEventHandler | undefined; description?: React.ReactNode; category?: string | undefined; canAccessFleet?: boolean | undefined; }" + ", \"onClick\" | \"description\" | \"isDisabled\" | \"button\" | \"layout\">> & { button?: React.ReactNode; onClick?: React.MouseEventHandler | undefined; description?: React.ReactNode; category?: string | undefined; canAccessFleet?: boolean | undefined; }" ], "path": "node_modules/@kbn/shared-ux-card-no-data-types/index.d.ts", "deprecated": false, @@ -176,21 +176,21 @@ "\nProps for the `NoDataCard` sevice-connected component." ], "signature": [ - "{ children?: React.ReactNode; onError?: React.ReactEventHandler | undefined; className?: string | undefined; id?: string | undefined; lang?: string | undefined; style?: React.CSSProperties | undefined; target?: string | undefined; role?: React.AriaRole | undefined; tabIndex?: number | undefined; display?: \"warning\" | \"primary\" | \"success\" | \"accent\" | \"danger\" | \"subdued\" | \"transparent\" | \"plain\" | undefined; href?: string | undefined; 'aria-activedescendant'?: string | undefined; 'aria-atomic'?: boolean | \"true\" | \"false\" | undefined; 'aria-autocomplete'?: \"none\" | \"list\" | \"inline\" | \"both\" | undefined; 'aria-busy'?: boolean | \"true\" | \"false\" | undefined; 'aria-checked'?: boolean | \"true\" | \"false\" | \"mixed\" | undefined; 'aria-colcount'?: number | undefined; 'aria-colindex'?: number | undefined; 'aria-colspan'?: number | undefined; 'aria-controls'?: string | undefined; 'aria-current'?: boolean | \"date\" | \"location\" | \"true\" | \"false\" | \"page\" | \"step\" | \"time\" | undefined; 'aria-describedby'?: string | undefined; 'aria-details'?: string | undefined; 'aria-disabled'?: boolean | \"true\" | \"false\" | undefined; 'aria-dropeffect'?: \"none\" | \"link\" | \"copy\" | \"execute\" | \"move\" | \"popup\" | undefined; 'aria-errormessage'?: string | undefined; 'aria-expanded'?: boolean | \"true\" | \"false\" | undefined; 'aria-flowto'?: string | undefined; 'aria-grabbed'?: boolean | \"true\" | \"false\" | undefined; 'aria-haspopup'?: boolean | \"dialog\" | \"grid\" | \"listbox\" | \"menu\" | \"tree\" | \"true\" | \"false\" | undefined; 'aria-hidden'?: boolean | \"true\" | \"false\" | undefined; 'aria-invalid'?: boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\" | undefined; 'aria-keyshortcuts'?: string | undefined; 'aria-label'?: string | undefined; 'aria-labelledby'?: string | undefined; 'aria-level'?: number | undefined; 'aria-live'?: \"off\" | \"assertive\" | \"polite\" | undefined; 'aria-modal'?: boolean | \"true\" | \"false\" | undefined; 'aria-multiline'?: boolean | \"true\" | \"false\" | undefined; 'aria-multiselectable'?: boolean | \"true\" | \"false\" | undefined; 'aria-orientation'?: \"horizontal\" | \"vertical\" | undefined; 'aria-owns'?: string | undefined; 'aria-placeholder'?: string | undefined; 'aria-posinset'?: number | undefined; 'aria-pressed'?: boolean | \"true\" | \"false\" | \"mixed\" | undefined; 'aria-readonly'?: boolean | \"true\" | \"false\" | undefined; 'aria-relevant'?: \"all\" | \"text\" | \"additions\" | \"additions removals\" | \"additions text\" | \"removals\" | \"removals additions\" | \"removals text\" | \"text additions\" | \"text removals\" | undefined; 'aria-required'?: boolean | \"true\" | \"false\" | undefined; 'aria-roledescription'?: string | undefined; 'aria-rowcount'?: number | undefined; 'aria-rowindex'?: number | undefined; 'aria-rowspan'?: number | undefined; 'aria-selected'?: boolean | \"true\" | \"false\" | undefined; 'aria-setsize'?: number | undefined; 'aria-sort'?: \"none\" | \"ascending\" | \"descending\" | \"other\" | undefined; 'aria-valuemax'?: number | undefined; 'aria-valuemin'?: number | undefined; 'aria-valuenow'?: number | undefined; 'aria-valuetext'?: string | undefined; dangerouslySetInnerHTML?: { __html: string; } | undefined; onCopy?: React.ClipboardEventHandler | undefined; onCopyCapture?: React.ClipboardEventHandler | undefined; onCut?: React.ClipboardEventHandler | undefined; onCutCapture?: React.ClipboardEventHandler | undefined; onPaste?: React.ClipboardEventHandler | undefined; onPasteCapture?: React.ClipboardEventHandler | undefined; onCompositionEnd?: React.CompositionEventHandler | undefined; onCompositionEndCapture?: React.CompositionEventHandler | undefined; onCompositionStart?: React.CompositionEventHandler | undefined; onCompositionStartCapture?: React.CompositionEventHandler | undefined; onCompositionUpdate?: React.CompositionEventHandler | undefined; onCompositionUpdateCapture?: React.CompositionEventHandler | undefined; onFocus?: React.FocusEventHandler | undefined; onFocusCapture?: React.FocusEventHandler | undefined; onBlur?: React.FocusEventHandler | undefined; onBlurCapture?: React.FocusEventHandler | undefined; onChange?: React.FormEventHandler | undefined; onChangeCapture?: React.FormEventHandler | undefined; onBeforeInput?: React.FormEventHandler | undefined; onBeforeInputCapture?: React.FormEventHandler | undefined; onInput?: React.FormEventHandler | undefined; onInputCapture?: React.FormEventHandler | undefined; onReset?: React.FormEventHandler | undefined; onResetCapture?: React.FormEventHandler | undefined; onSubmit?: React.FormEventHandler | undefined; onSubmitCapture?: React.FormEventHandler | undefined; onInvalid?: React.FormEventHandler | undefined; onInvalidCapture?: React.FormEventHandler | undefined; onLoad?: React.ReactEventHandler | undefined; onLoadCapture?: React.ReactEventHandler | undefined; onErrorCapture?: React.ReactEventHandler | undefined; onKeyDown?: React.KeyboardEventHandler | undefined; onKeyDownCapture?: React.KeyboardEventHandler | undefined; onKeyPress?: React.KeyboardEventHandler | undefined; onKeyPressCapture?: React.KeyboardEventHandler | undefined; onKeyUp?: React.KeyboardEventHandler | undefined; onKeyUpCapture?: React.KeyboardEventHandler | undefined; onAbort?: React.ReactEventHandler | undefined; onAbortCapture?: React.ReactEventHandler | undefined; onCanPlay?: React.ReactEventHandler | undefined; onCanPlayCapture?: React.ReactEventHandler | undefined; onCanPlayThrough?: React.ReactEventHandler | undefined; onCanPlayThroughCapture?: React.ReactEventHandler | undefined; onDurationChange?: React.ReactEventHandler | undefined; onDurationChangeCapture?: React.ReactEventHandler | undefined; onEmptied?: React.ReactEventHandler | undefined; onEmptiedCapture?: React.ReactEventHandler | undefined; onEncrypted?: React.ReactEventHandler | undefined; onEncryptedCapture?: React.ReactEventHandler | undefined; onEnded?: React.ReactEventHandler | undefined; onEndedCapture?: React.ReactEventHandler | undefined; onLoadedData?: React.ReactEventHandler | undefined; onLoadedDataCapture?: React.ReactEventHandler | undefined; onLoadedMetadata?: React.ReactEventHandler | undefined; onLoadedMetadataCapture?: React.ReactEventHandler | undefined; onLoadStart?: React.ReactEventHandler | undefined; onLoadStartCapture?: React.ReactEventHandler | undefined; onPause?: React.ReactEventHandler | undefined; onPauseCapture?: React.ReactEventHandler | undefined; onPlay?: React.ReactEventHandler | undefined; onPlayCapture?: React.ReactEventHandler | undefined; onPlaying?: React.ReactEventHandler | undefined; onPlayingCapture?: React.ReactEventHandler | undefined; onProgress?: React.ReactEventHandler | undefined; onProgressCapture?: React.ReactEventHandler | undefined; onRateChange?: React.ReactEventHandler | undefined; onRateChangeCapture?: React.ReactEventHandler | undefined; onSeeked?: React.ReactEventHandler | undefined; onSeekedCapture?: React.ReactEventHandler | undefined; onSeeking?: React.ReactEventHandler | undefined; onSeekingCapture?: React.ReactEventHandler | undefined; onStalled?: React.ReactEventHandler | undefined; onStalledCapture?: React.ReactEventHandler | undefined; onSuspend?: React.ReactEventHandler | undefined; onSuspendCapture?: React.ReactEventHandler | undefined; onTimeUpdate?: React.ReactEventHandler | undefined; onTimeUpdateCapture?: React.ReactEventHandler | undefined; onVolumeChange?: React.ReactEventHandler | undefined; onVolumeChangeCapture?: React.ReactEventHandler | undefined; onWaiting?: React.ReactEventHandler | undefined; onWaitingCapture?: React.ReactEventHandler | undefined; onAuxClick?: React.MouseEventHandler | undefined; onAuxClickCapture?: React.MouseEventHandler | undefined; onClick?: React.MouseEventHandler | undefined; onClickCapture?: React.MouseEventHandler | undefined; onContextMenu?: React.MouseEventHandler | undefined; onContextMenuCapture?: React.MouseEventHandler | undefined; onDoubleClick?: React.MouseEventHandler | undefined; onDoubleClickCapture?: React.MouseEventHandler | undefined; onDrag?: React.DragEventHandler | undefined; onDragCapture?: React.DragEventHandler | undefined; onDragEnd?: React.DragEventHandler | undefined; onDragEndCapture?: React.DragEventHandler | undefined; onDragEnter?: React.DragEventHandler | undefined; onDragEnterCapture?: React.DragEventHandler | undefined; onDragExit?: React.DragEventHandler | undefined; onDragExitCapture?: React.DragEventHandler | undefined; onDragLeave?: React.DragEventHandler | undefined; onDragLeaveCapture?: React.DragEventHandler | undefined; onDragOver?: React.DragEventHandler | undefined; onDragOverCapture?: React.DragEventHandler | undefined; onDragStart?: React.DragEventHandler | undefined; onDragStartCapture?: React.DragEventHandler | undefined; onDrop?: React.DragEventHandler | undefined; onDropCapture?: React.DragEventHandler | undefined; onMouseDown?: React.MouseEventHandler | undefined; onMouseDownCapture?: React.MouseEventHandler | undefined; onMouseEnter?: React.MouseEventHandler | undefined; onMouseLeave?: React.MouseEventHandler | undefined; onMouseMove?: React.MouseEventHandler | undefined; onMouseMoveCapture?: React.MouseEventHandler | undefined; onMouseOut?: React.MouseEventHandler | undefined; onMouseOutCapture?: React.MouseEventHandler | undefined; onMouseOver?: React.MouseEventHandler | undefined; onMouseOverCapture?: React.MouseEventHandler | undefined; onMouseUp?: React.MouseEventHandler | undefined; onMouseUpCapture?: React.MouseEventHandler | undefined; onSelect?: React.ReactEventHandler | undefined; onSelectCapture?: React.ReactEventHandler | undefined; onTouchCancel?: React.TouchEventHandler | undefined; onTouchCancelCapture?: React.TouchEventHandler | undefined; onTouchEnd?: React.TouchEventHandler | undefined; onTouchEndCapture?: React.TouchEventHandler | undefined; onTouchMove?: React.TouchEventHandler | undefined; onTouchMoveCapture?: React.TouchEventHandler | undefined; onTouchStart?: React.TouchEventHandler | undefined; onTouchStartCapture?: React.TouchEventHandler | undefined; onPointerDown?: React.PointerEventHandler | undefined; onPointerDownCapture?: React.PointerEventHandler | undefined; onPointerMove?: React.PointerEventHandler | undefined; onPointerMoveCapture?: React.PointerEventHandler | undefined; onPointerUp?: React.PointerEventHandler | undefined; onPointerUpCapture?: React.PointerEventHandler | undefined; onPointerCancel?: React.PointerEventHandler | undefined; onPointerCancelCapture?: React.PointerEventHandler | undefined; onPointerEnter?: React.PointerEventHandler | undefined; onPointerEnterCapture?: React.PointerEventHandler | undefined; onPointerLeave?: React.PointerEventHandler | undefined; onPointerLeaveCapture?: React.PointerEventHandler | undefined; onPointerOver?: React.PointerEventHandler | undefined; onPointerOverCapture?: React.PointerEventHandler | undefined; onPointerOut?: React.PointerEventHandler | undefined; onPointerOutCapture?: React.PointerEventHandler | undefined; onGotPointerCapture?: React.PointerEventHandler | undefined; onGotPointerCaptureCapture?: React.PointerEventHandler | undefined; onLostPointerCapture?: React.PointerEventHandler | undefined; onLostPointerCaptureCapture?: React.PointerEventHandler | undefined; onScroll?: React.UIEventHandler | undefined; onScrollCapture?: React.UIEventHandler | undefined; onWheel?: React.WheelEventHandler | undefined; onWheelCapture?: React.WheelEventHandler | undefined; onAnimationStart?: React.AnimationEventHandler | undefined; onAnimationStartCapture?: React.AnimationEventHandler | undefined; onAnimationEnd?: React.AnimationEventHandler | undefined; onAnimationEndCapture?: React.AnimationEventHandler | undefined; onAnimationIteration?: React.AnimationEventHandler | undefined; onAnimationIterationCapture?: React.AnimationEventHandler | undefined; onTransitionEnd?: React.TransitionEventHandler | undefined; onTransitionEndCapture?: React.TransitionEventHandler | undefined; 'data-test-subj'?: string | undefined; title?: boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | undefined; button?: React.ReactNode; hidden?: boolean | undefined; icon?: React.ReactElement<", + "{ children?: React.ReactNode; onError?: React.ReactEventHandler | undefined; hidden?: boolean | undefined; icon?: React.ReactElement<", "EuiIconProps", - ", string | React.JSXElementConstructor> | null | undefined; image?: string | React.ReactElement> | undefined; description?: React.ReactNode; security?: string | undefined; defaultValue?: string | number | readonly string[] | undefined; category?: string | undefined; defaultChecked?: boolean | undefined; suppressContentEditableWarning?: boolean | undefined; suppressHydrationWarning?: boolean | undefined; accessKey?: string | undefined; contentEditable?: \"inherit\" | Booleanish | undefined; contextMenu?: string | undefined; dir?: string | undefined; draggable?: Booleanish | undefined; placeholder?: string | undefined; slot?: string | undefined; spellCheck?: Booleanish | undefined; translate?: \"no\" | \"yes\" | undefined; radioGroup?: string | undefined; about?: string | undefined; datatype?: string | undefined; inlist?: any; prefix?: string | undefined; property?: string | undefined; resource?: string | undefined; typeof?: string | undefined; vocab?: string | undefined; autoCapitalize?: string | undefined; autoCorrect?: string | undefined; autoSave?: string | undefined; itemProp?: string | undefined; itemScope?: boolean | undefined; itemType?: string | undefined; itemID?: string | undefined; itemRef?: string | undefined; results?: number | undefined; unselectable?: \"off\" | \"on\" | undefined; inputMode?: \"none\" | \"text\" | \"search\" | \"email\" | \"tel\" | \"url\" | \"numeric\" | \"decimal\" | undefined; is?: string | undefined; rel?: string | undefined; paddingSize?: \"none\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"xs\" | undefined; footer?: React.ReactNode; hasBorder?: boolean | undefined; textAlign?: CardAlignment | undefined; titleElement?: \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"span\" | undefined; titleSize?: \"s\" | \"xs\" | undefined; betaBadgeProps?: Partial<(", + ", string | React.JSXElementConstructor> | null | undefined; image?: string | React.ReactElement> | undefined; className?: string | undefined; title?: boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | undefined; onChange?: React.FormEventHandler | undefined; onKeyDown?: React.KeyboardEventHandler | undefined; onClick?: React.MouseEventHandler | undefined; id?: string | undefined; description?: React.ReactNode; security?: string | undefined; defaultValue?: string | number | readonly string[] | undefined; lang?: string | undefined; category?: string | undefined; defaultChecked?: boolean | undefined; suppressContentEditableWarning?: boolean | undefined; suppressHydrationWarning?: boolean | undefined; accessKey?: string | undefined; contentEditable?: \"inherit\" | Booleanish | undefined; contextMenu?: string | undefined; dir?: string | undefined; draggable?: Booleanish | undefined; placeholder?: string | undefined; slot?: string | undefined; spellCheck?: Booleanish | undefined; style?: React.CSSProperties | undefined; tabIndex?: number | undefined; translate?: \"no\" | \"yes\" | undefined; radioGroup?: string | undefined; role?: React.AriaRole | undefined; about?: string | undefined; datatype?: string | undefined; inlist?: any; prefix?: string | undefined; property?: string | undefined; resource?: string | undefined; typeof?: string | undefined; vocab?: string | undefined; autoCapitalize?: string | undefined; autoCorrect?: string | undefined; autoSave?: string | undefined; itemProp?: string | undefined; itemScope?: boolean | undefined; itemType?: string | undefined; itemID?: string | undefined; itemRef?: string | undefined; results?: number | undefined; unselectable?: \"on\" | \"off\" | undefined; inputMode?: \"none\" | \"email\" | \"search\" | \"text\" | \"tel\" | \"url\" | \"numeric\" | \"decimal\" | undefined; is?: string | undefined; 'aria-activedescendant'?: string | undefined; 'aria-atomic'?: boolean | \"false\" | \"true\" | undefined; 'aria-autocomplete'?: \"none\" | \"list\" | \"inline\" | \"both\" | undefined; 'aria-busy'?: boolean | \"false\" | \"true\" | undefined; 'aria-checked'?: boolean | \"mixed\" | \"false\" | \"true\" | undefined; 'aria-colcount'?: number | undefined; 'aria-colindex'?: number | undefined; 'aria-colspan'?: number | undefined; 'aria-controls'?: string | undefined; 'aria-current'?: boolean | \"date\" | \"location\" | \"time\" | \"page\" | \"false\" | \"true\" | \"step\" | undefined; 'aria-describedby'?: string | undefined; 'aria-details'?: string | undefined; 'aria-disabled'?: boolean | \"false\" | \"true\" | undefined; 'aria-dropeffect'?: \"none\" | \"copy\" | \"link\" | \"execute\" | \"move\" | \"popup\" | undefined; 'aria-errormessage'?: string | undefined; 'aria-expanded'?: boolean | \"false\" | \"true\" | undefined; 'aria-flowto'?: string | undefined; 'aria-grabbed'?: boolean | \"false\" | \"true\" | undefined; 'aria-haspopup'?: boolean | \"grid\" | \"menu\" | \"false\" | \"true\" | \"dialog\" | \"listbox\" | \"tree\" | undefined; 'aria-hidden'?: boolean | \"false\" | \"true\" | undefined; 'aria-invalid'?: boolean | \"false\" | \"true\" | \"grammar\" | \"spelling\" | undefined; 'aria-keyshortcuts'?: string | undefined; 'aria-label'?: string | undefined; 'aria-labelledby'?: string | undefined; 'aria-level'?: number | undefined; 'aria-live'?: \"off\" | \"assertive\" | \"polite\" | undefined; 'aria-modal'?: boolean | \"false\" | \"true\" | undefined; 'aria-multiline'?: boolean | \"false\" | \"true\" | undefined; 'aria-multiselectable'?: boolean | \"false\" | \"true\" | undefined; 'aria-orientation'?: \"horizontal\" | \"vertical\" | undefined; 'aria-owns'?: string | undefined; 'aria-placeholder'?: string | undefined; 'aria-posinset'?: number | undefined; 'aria-pressed'?: boolean | \"mixed\" | \"false\" | \"true\" | undefined; 'aria-readonly'?: boolean | \"false\" | \"true\" | undefined; 'aria-relevant'?: \"all\" | \"text\" | \"additions\" | \"additions removals\" | \"additions text\" | \"removals\" | \"removals additions\" | \"removals text\" | \"text additions\" | \"text removals\" | undefined; 'aria-required'?: boolean | \"false\" | \"true\" | undefined; 'aria-roledescription'?: string | undefined; 'aria-rowcount'?: number | undefined; 'aria-rowindex'?: number | undefined; 'aria-rowspan'?: number | undefined; 'aria-selected'?: boolean | \"false\" | \"true\" | undefined; 'aria-setsize'?: number | undefined; 'aria-sort'?: \"none\" | \"other\" | \"ascending\" | \"descending\" | undefined; 'aria-valuemax'?: number | undefined; 'aria-valuemin'?: number | undefined; 'aria-valuenow'?: number | undefined; 'aria-valuetext'?: string | undefined; dangerouslySetInnerHTML?: { __html: string; } | undefined; onCopy?: React.ClipboardEventHandler | undefined; onCopyCapture?: React.ClipboardEventHandler | undefined; onCut?: React.ClipboardEventHandler | undefined; onCutCapture?: React.ClipboardEventHandler | undefined; onPaste?: React.ClipboardEventHandler | undefined; onPasteCapture?: React.ClipboardEventHandler | undefined; onCompositionEnd?: React.CompositionEventHandler | undefined; onCompositionEndCapture?: React.CompositionEventHandler | undefined; onCompositionStart?: React.CompositionEventHandler | undefined; onCompositionStartCapture?: React.CompositionEventHandler | undefined; onCompositionUpdate?: React.CompositionEventHandler | undefined; onCompositionUpdateCapture?: React.CompositionEventHandler | undefined; onFocus?: React.FocusEventHandler | undefined; onFocusCapture?: React.FocusEventHandler | undefined; onBlur?: React.FocusEventHandler | undefined; onBlurCapture?: React.FocusEventHandler | undefined; onChangeCapture?: React.FormEventHandler | undefined; onBeforeInput?: React.FormEventHandler | undefined; onBeforeInputCapture?: React.FormEventHandler | undefined; onInput?: React.FormEventHandler | undefined; onInputCapture?: React.FormEventHandler | undefined; onReset?: React.FormEventHandler | undefined; onResetCapture?: React.FormEventHandler | undefined; onSubmit?: React.FormEventHandler | undefined; onSubmitCapture?: React.FormEventHandler | undefined; onInvalid?: React.FormEventHandler | undefined; onInvalidCapture?: React.FormEventHandler | undefined; onLoad?: React.ReactEventHandler | undefined; onLoadCapture?: React.ReactEventHandler | undefined; onErrorCapture?: React.ReactEventHandler | undefined; onKeyDownCapture?: React.KeyboardEventHandler | undefined; onKeyPress?: React.KeyboardEventHandler | undefined; onKeyPressCapture?: React.KeyboardEventHandler | undefined; onKeyUp?: React.KeyboardEventHandler | undefined; onKeyUpCapture?: React.KeyboardEventHandler | undefined; onAbort?: React.ReactEventHandler | undefined; onAbortCapture?: React.ReactEventHandler | undefined; onCanPlay?: React.ReactEventHandler | undefined; onCanPlayCapture?: React.ReactEventHandler | undefined; onCanPlayThrough?: React.ReactEventHandler | undefined; onCanPlayThroughCapture?: React.ReactEventHandler | undefined; onDurationChange?: React.ReactEventHandler | undefined; onDurationChangeCapture?: React.ReactEventHandler | undefined; onEmptied?: React.ReactEventHandler | undefined; onEmptiedCapture?: React.ReactEventHandler | undefined; onEncrypted?: React.ReactEventHandler | undefined; onEncryptedCapture?: React.ReactEventHandler | undefined; onEnded?: React.ReactEventHandler | undefined; onEndedCapture?: React.ReactEventHandler | undefined; onLoadedData?: React.ReactEventHandler | undefined; onLoadedDataCapture?: React.ReactEventHandler | undefined; onLoadedMetadata?: React.ReactEventHandler | undefined; onLoadedMetadataCapture?: React.ReactEventHandler | undefined; onLoadStart?: React.ReactEventHandler | undefined; onLoadStartCapture?: React.ReactEventHandler | undefined; onPause?: React.ReactEventHandler | undefined; onPauseCapture?: React.ReactEventHandler | undefined; onPlay?: React.ReactEventHandler | undefined; onPlayCapture?: React.ReactEventHandler | undefined; onPlaying?: React.ReactEventHandler | undefined; onPlayingCapture?: React.ReactEventHandler | undefined; onProgress?: React.ReactEventHandler | undefined; onProgressCapture?: React.ReactEventHandler | undefined; onRateChange?: React.ReactEventHandler | undefined; onRateChangeCapture?: React.ReactEventHandler | undefined; onSeeked?: React.ReactEventHandler | undefined; onSeekedCapture?: React.ReactEventHandler | undefined; onSeeking?: React.ReactEventHandler | undefined; onSeekingCapture?: React.ReactEventHandler | undefined; onStalled?: React.ReactEventHandler | undefined; onStalledCapture?: React.ReactEventHandler | undefined; onSuspend?: React.ReactEventHandler | undefined; onSuspendCapture?: React.ReactEventHandler | undefined; onTimeUpdate?: React.ReactEventHandler | undefined; onTimeUpdateCapture?: React.ReactEventHandler | undefined; onVolumeChange?: React.ReactEventHandler | undefined; onVolumeChangeCapture?: React.ReactEventHandler | undefined; onWaiting?: React.ReactEventHandler | undefined; onWaitingCapture?: React.ReactEventHandler | undefined; onAuxClick?: React.MouseEventHandler | undefined; onAuxClickCapture?: React.MouseEventHandler | undefined; onClickCapture?: React.MouseEventHandler | undefined; onContextMenu?: React.MouseEventHandler | undefined; onContextMenuCapture?: React.MouseEventHandler | undefined; onDoubleClick?: React.MouseEventHandler | undefined; onDoubleClickCapture?: React.MouseEventHandler | undefined; onDrag?: React.DragEventHandler | undefined; onDragCapture?: React.DragEventHandler | undefined; onDragEnd?: React.DragEventHandler | undefined; onDragEndCapture?: React.DragEventHandler | undefined; onDragEnter?: React.DragEventHandler | undefined; onDragEnterCapture?: React.DragEventHandler | undefined; onDragExit?: React.DragEventHandler | undefined; onDragExitCapture?: React.DragEventHandler | undefined; onDragLeave?: React.DragEventHandler | undefined; onDragLeaveCapture?: React.DragEventHandler | undefined; onDragOver?: React.DragEventHandler | undefined; onDragOverCapture?: React.DragEventHandler | undefined; onDragStart?: React.DragEventHandler | undefined; onDragStartCapture?: React.DragEventHandler | undefined; onDrop?: React.DragEventHandler | undefined; onDropCapture?: React.DragEventHandler | undefined; onMouseDown?: React.MouseEventHandler | undefined; onMouseDownCapture?: React.MouseEventHandler | undefined; onMouseEnter?: React.MouseEventHandler | undefined; onMouseLeave?: React.MouseEventHandler | undefined; onMouseMove?: React.MouseEventHandler | undefined; onMouseMoveCapture?: React.MouseEventHandler | undefined; onMouseOut?: React.MouseEventHandler | undefined; onMouseOutCapture?: React.MouseEventHandler | undefined; onMouseOver?: React.MouseEventHandler | undefined; onMouseOverCapture?: React.MouseEventHandler | undefined; onMouseUp?: React.MouseEventHandler | undefined; onMouseUpCapture?: React.MouseEventHandler | undefined; onSelect?: React.ReactEventHandler | undefined; onSelectCapture?: React.ReactEventHandler | undefined; onTouchCancel?: React.TouchEventHandler | undefined; onTouchCancelCapture?: React.TouchEventHandler | undefined; onTouchEnd?: React.TouchEventHandler | undefined; onTouchEndCapture?: React.TouchEventHandler | undefined; onTouchMove?: React.TouchEventHandler | undefined; onTouchMoveCapture?: React.TouchEventHandler | undefined; onTouchStart?: React.TouchEventHandler | undefined; onTouchStartCapture?: React.TouchEventHandler | undefined; onPointerDown?: React.PointerEventHandler | undefined; onPointerDownCapture?: React.PointerEventHandler | undefined; onPointerMove?: React.PointerEventHandler | undefined; onPointerMoveCapture?: React.PointerEventHandler | undefined; onPointerUp?: React.PointerEventHandler | undefined; onPointerUpCapture?: React.PointerEventHandler | undefined; onPointerCancel?: React.PointerEventHandler | undefined; onPointerCancelCapture?: React.PointerEventHandler | undefined; onPointerEnter?: React.PointerEventHandler | undefined; onPointerEnterCapture?: React.PointerEventHandler | undefined; onPointerLeave?: React.PointerEventHandler | undefined; onPointerLeaveCapture?: React.PointerEventHandler | undefined; onPointerOver?: React.PointerEventHandler | undefined; onPointerOverCapture?: React.PointerEventHandler | undefined; onPointerOut?: React.PointerEventHandler | undefined; onPointerOutCapture?: React.PointerEventHandler | undefined; onGotPointerCapture?: React.PointerEventHandler | undefined; onGotPointerCaptureCapture?: React.PointerEventHandler | undefined; onLostPointerCapture?: React.PointerEventHandler | undefined; onLostPointerCaptureCapture?: React.PointerEventHandler | undefined; onScroll?: React.UIEventHandler | undefined; onScrollCapture?: React.UIEventHandler | undefined; onWheel?: React.WheelEventHandler | undefined; onWheelCapture?: React.WheelEventHandler | undefined; onAnimationStart?: React.AnimationEventHandler | undefined; onAnimationStartCapture?: React.AnimationEventHandler | undefined; onAnimationEnd?: React.AnimationEventHandler | undefined; onAnimationEndCapture?: React.AnimationEventHandler | undefined; onAnimationIteration?: React.AnimationEventHandler | undefined; onAnimationIterationCapture?: React.AnimationEventHandler | undefined; onTransitionEnd?: React.TransitionEventHandler | undefined; onTransitionEndCapture?: React.TransitionEventHandler | undefined; 'data-test-subj'?: string | undefined; href?: string | undefined; rel?: string | undefined; target?: string | undefined; paddingSize?: \"none\" | \"m\" | \"s\" | \"xs\" | \"l\" | \"xl\" | undefined; button?: React.ReactNode; footer?: React.ReactNode; hasBorder?: boolean | undefined; textAlign?: CardAlignment | undefined; titleElement?: \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"span\" | undefined; titleSize?: \"s\" | \"xs\" | undefined; betaBadgeProps?: Partial<(", "CommonProps", " & ", "DisambiguateSet", "<(", "DisambiguateSet", - " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">), WithSpanProps> & WithSpanProps & { iconType?: ", "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -200,13 +200,13 @@ "DisambiguateSet", "<(", "DisambiguateSet", - " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">), WithSpanProps> & WithSpanProps & { iconType?: ", "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -218,15 +218,15 @@ "DisambiguateSet", " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">)> & ", "DisambiguateSet", - " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\"> & { iconType?: ", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\"> & { iconType?: ", "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -236,15 +236,15 @@ "DisambiguateSet", " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">)> & ", "DisambiguateSet", - " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\"> & { iconType?: ", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\"> & { iconType?: ", "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -256,15 +256,15 @@ "DisambiguateSet", " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">)> & ", "DisambiguateSet", - " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\"> & { iconType?: ", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\"> & { iconType?: ", "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -276,7 +276,7 @@ "DisambiguateSet", " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">)> & ", "DisambiguateSet", @@ -284,7 +284,7 @@ "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -294,7 +294,7 @@ "DisambiguateSet", " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">)> & ", "DisambiguateSet", @@ -302,7 +302,7 @@ "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -314,7 +314,7 @@ "DisambiguateSet", " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">)> & ", "DisambiguateSet", @@ -322,13 +322,13 @@ "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", " & ", "DisambiguateSet", - "<{ tooltipContent: React.ReactNode; title?: string | undefined; }, { title: string; tooltipContent?: React.ReactNode; }> & { title: string; tooltipContent?: React.ReactNode; } & { label: React.ReactNode; })> | undefined; selectable?: ", + "<{ tooltipContent: React.ReactNode; title?: string | undefined; }, { title: string; tooltipContent?: React.ReactNode; }> & { title: string; tooltipContent?: React.ReactNode; } & { label: React.ReactNode; })> | undefined; display?: \"warning\" | \"subdued\" | \"primary\" | \"accent\" | \"success\" | \"danger\" | \"transparent\" | \"plain\" | undefined; selectable?: ", "EuiCardSelectProps", " | undefined; }" ], diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index 95ea4c904eebb..f3907f21f4aac 100644 --- a/api_docs/kbn_shared_ux_card_no_data.mdx +++ b/api_docs/kbn_shared_ux_card_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data title: "@kbn/shared-ux-card-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data'] --- import kbnSharedUxCardNoDataObj from './kbn_shared_ux_card_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data_mocks.devdocs.json b/api_docs/kbn_shared_ux_card_no_data_mocks.devdocs.json index c3f38d680e208..9be1d1c11795d 100644 --- a/api_docs/kbn_shared_ux_card_no_data_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_card_no_data_mocks.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock", + "id": "def-common.StorybookMock", "type": "Class", "tags": [], "label": "StorybookMock", @@ -22,9 +30,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-card-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", - "section": "def-server.StorybookMock", + "section": "def-common.StorybookMock", "text": "StorybookMock" }, " extends ", @@ -40,7 +48,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments", + "id": "def-common.StorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -50,7 +58,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.category", + "id": "def-common.StorybookMock.propArguments.category", "type": "Object", "tags": [], "label": "category", @@ -60,7 +68,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.category.control", + "id": "def-common.StorybookMock.propArguments.category.control", "type": "Object", "tags": [], "label": "control", @@ -70,7 +78,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.category.control.type", + "id": "def-common.StorybookMock.propArguments.category.control.type", "type": "string", "tags": [], "label": "type", @@ -82,7 +90,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.category.defaultValue", + "id": "def-common.StorybookMock.propArguments.category.defaultValue", "type": "string", "tags": [], "label": "defaultValue", @@ -94,7 +102,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.title", + "id": "def-common.StorybookMock.propArguments.title", "type": "Object", "tags": [], "label": "title", @@ -104,7 +112,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.title.control", + "id": "def-common.StorybookMock.propArguments.title.control", "type": "Object", "tags": [], "label": "control", @@ -114,7 +122,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.title.control.type", + "id": "def-common.StorybookMock.propArguments.title.control.type", "type": "string", "tags": [], "label": "type", @@ -126,7 +134,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.title.defaultValue", + "id": "def-common.StorybookMock.propArguments.title.defaultValue", "type": "string", "tags": [], "label": "defaultValue", @@ -138,7 +146,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.description", + "id": "def-common.StorybookMock.propArguments.description", "type": "Object", "tags": [], "label": "description", @@ -148,7 +156,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.description.control", + "id": "def-common.StorybookMock.propArguments.description.control", "type": "Object", "tags": [], "label": "control", @@ -158,7 +166,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.description.control.type", + "id": "def-common.StorybookMock.propArguments.description.control.type", "type": "string", "tags": [], "label": "type", @@ -170,7 +178,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.description.defaultValue", + "id": "def-common.StorybookMock.propArguments.description.defaultValue", "type": "string", "tags": [], "label": "defaultValue", @@ -182,7 +190,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.button", + "id": "def-common.StorybookMock.propArguments.button", "type": "Object", "tags": [], "label": "button", @@ -192,7 +200,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.button.control", + "id": "def-common.StorybookMock.propArguments.button.control", "type": "Object", "tags": [], "label": "control", @@ -202,7 +210,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.button.control.type", + "id": "def-common.StorybookMock.propArguments.button.control.type", "type": "string", "tags": [], "label": "type", @@ -214,7 +222,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.button.defaultValue", + "id": "def-common.StorybookMock.propArguments.button.defaultValue", "type": "string", "tags": [], "label": "defaultValue", @@ -228,7 +236,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments", + "id": "def-common.StorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -238,7 +246,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.canAccessFleet", + "id": "def-common.StorybookMock.serviceArguments.canAccessFleet", "type": "Object", "tags": [], "label": "canAccessFleet", @@ -248,7 +256,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.canAccessFleet.control", + "id": "def-common.StorybookMock.serviceArguments.canAccessFleet.control", "type": "string", "tags": [], "label": "control", @@ -258,7 +266,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.canAccessFleet.defaultValue", + "id": "def-common.StorybookMock.serviceArguments.canAccessFleet.defaultValue", "type": "boolean", "tags": [], "label": "defaultValue", @@ -272,7 +280,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.dependencies", + "id": "def-common.StorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -286,7 +294,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.getProps", + "id": "def-common.StorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -295,9 +303,9 @@ "(params?: ", { "pluginId": "@kbn/shared-ux-card-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, " | undefined) => ", @@ -308,7 +316,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.getProps.$1", + "id": "def-common.StorybookMock.getProps.$1", "type": "Object", "tags": [], "label": "params", @@ -316,9 +324,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-card-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, " | undefined" @@ -332,7 +340,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.getServices", + "id": "def-common.StorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -341,9 +349,9 @@ "(params: ", { "pluginId": "@kbn/shared-ux-card-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, ") => ", @@ -354,7 +362,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.getServices.$1", + "id": "def-common.StorybookMock.getServices.$1", "type": "Object", "tags": [], "label": "params", @@ -362,9 +370,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-card-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" } ], @@ -382,7 +390,7 @@ "functions": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.getKibanaDependenciesMock", + "id": "def-common.getKibanaDependenciesMock", "type": "Function", "tags": [], "label": "getKibanaDependenciesMock", @@ -400,7 +408,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.getKibanaDependenciesMock.$1", + "id": "def-common.getKibanaDependenciesMock.$1", "type": "Object", "tags": [], "label": "params", @@ -420,7 +428,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.getServicesMock", + "id": "def-common.getServicesMock", "type": "Function", "tags": [], "label": "getServicesMock", @@ -438,7 +446,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.getServicesMock.$1", + "id": "def-common.getServicesMock.$1", "type": "Object", "tags": [], "label": "params", @@ -462,7 +470,7 @@ "misc": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.Params", + "id": "def-common.Params", "type": "Type", "tags": [], "label": "Params", @@ -470,7 +478,7 @@ "\nStorybook parameters provided from the controls addon." ], "signature": [ - "{ title: any; button: any; description: any; category: any; canAccessFleet: any; }" + "{ title: any; description: any; category: any; button: any; canAccessFleet: any; }" ], "path": "packages/shared-ux/card/no_data/mocks/src/storybook.ts", "deprecated": false, @@ -478,13 +486,5 @@ } ], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx index bcf578a5a24b7..512dd0e08412c 100644 --- a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data-mocks title: "@kbn/shared-ux-card-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data-mocks'] --- import kbnSharedUxCardNoDataMocksObj from './kbn_shared_ux_card_no_data_mocks.devdocs.json'; @@ -23,14 +23,14 @@ Contact [Owner missing] for questions regarding this plugin. |-------------------|-----------|------------------------|-----------------| | 32 | 0 | 28 | 0 | -## Server +## Common ### Functions - + ### Classes - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_components.devdocs.json b/api_docs/kbn_shared_ux_components.devdocs.json deleted file mode 100644 index 48342694fc62e..0000000000000 --- a/api_docs/kbn_shared_ux_components.devdocs.json +++ /dev/null @@ -1,257 +0,0 @@ -{ - "id": "@kbn/shared-ux-components", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.KibanaPageTemplate", - "type": "Function", - "tags": [], - "label": "KibanaPageTemplate", - "description": [], - "signature": [ - "({ template, className, children, solutionNav, noDataConfig, ...rest }: React.PropsWithChildren<", - { - "pluginId": "@kbn/shared-ux-components", - "scope": "common", - "docId": "kibKbnSharedUxComponentsPluginApi", - "section": "def-common.KibanaPageTemplateProps", - "text": "KibanaPageTemplateProps" - }, - ">) => JSX.Element" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/page_template.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.KibanaPageTemplate.$1", - "type": "CompoundType", - "tags": [], - "label": "{\n template,\n className,\n children,\n solutionNav,\n noDataConfig,\n ...rest\n}", - "description": [], - "signature": [ - "React.PropsWithChildren<", - { - "pluginId": "@kbn/shared-ux-components", - "scope": "common", - "docId": "kibKbnSharedUxComponentsPluginApi", - "section": "def-common.KibanaPageTemplateProps", - "text": "KibanaPageTemplateProps" - }, - ">" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/page_template.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataConfigPage", - "type": "Function", - "tags": [], - "label": "NoDataConfigPage", - "description": [], - "signature": [ - "(props: ", - { - "pluginId": "@kbn/shared-ux-components", - "scope": "common", - "docId": "kibKbnSharedUxComponentsPluginApi", - "section": "def-common.KibanaPageTemplateProps", - "text": "KibanaPageTemplateProps" - }, - ") => JSX.Element | null" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataConfigPage.$1", - "type": "CompoundType", - "tags": [], - "label": "props", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-components", - "scope": "common", - "docId": "kibKbnSharedUxComponentsPluginApi", - "section": "def-common.KibanaPageTemplateProps", - "text": "KibanaPageTemplateProps" - } - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - } - ], - "interfaces": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataPageProps", - "type": "Interface", - "tags": [], - "label": "NoDataPageProps", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-components", - "scope": "common", - "docId": "kibKbnSharedUxComponentsPluginApi", - "section": "def-common.NoDataPageProps", - "text": "NoDataPageProps" - }, - " extends ", - "CommonProps" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataPageProps.solution", - "type": "string", - "tags": [], - "label": "solution", - "description": [ - "\nSingle name for the current solution, used to auto-generate the title, logo, description, and button label" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataPageProps.logo", - "type": "string", - "tags": [], - "label": "logo", - "description": [ - "\nOptionally replace the auto-generated logo" - ], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataPageProps.docsLink", - "type": "string", - "tags": [], - "label": "docsLink", - "description": [ - "\nRequired to set the docs link for the whole solution" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataPageProps.pageTitle", - "type": "string", - "tags": [], - "label": "pageTitle", - "description": [ - "\nOptionally replace the auto-generated page title (h1)" - ], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataPageProps.action", - "type": "Object", - "tags": [], - "label": "action", - "description": [ - "\nAn object of `NoDataPageActions`.\nUse `elasticAgent` as the primary key for pre-configured cards of this type.\nOtherwise use a custom key that contains `EuiCard` props." - ], - "signature": [ - "{ [x: string]: ", - "NoDataCardProps", - "; }" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - } - ], - "enums": [], - "misc": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.KibanaPageTemplateProps", - "type": "Type", - "tags": [], - "label": "KibanaPageTemplateProps", - "description": [], - "signature": [ - "Omit<", - "EuiPageProps", - ", \"paddingSize\"> & { template?: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\" | undefined; paddingSize?: \"none\" | \"s\" | \"m\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", - "EuiPageSideBarProps", - " | undefined; pageHeader?: ", - "EuiPageHeaderProps", - " | undefined; pageBodyProps?: ", - "EuiPageBodyProps", - "<\"main\"> | undefined; pageContentProps?: ", - "EuiPageContentProps", - " | undefined; pageContentBodyProps?: ", - "EuiPageContentBodyProps", - " | undefined; bottomBar?: React.ReactNode; bottomBarProps?: ", - "EuiBottomBarProps", - " | undefined; fullHeight?: boolean | \"noscroll\" | undefined; minHeight?: ", - "Property", - ".MinHeight | undefined; } & { isEmptyState?: boolean | undefined; solutionNav?: ", - "SolutionNavProps", - " | undefined; noDataConfig?: ", - { - "pluginId": "@kbn/shared-ux-components", - "scope": "common", - "docId": "kibKbnSharedUxComponentsPluginApi", - "section": "def-common.NoDataPageProps", - "text": "NoDataPageProps" - }, - " | undefined; }" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/types.ts", - "deprecated": false, - "initialIsOpen": false - } - ], - "objects": [] - } -} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_link_redirect_app_mocks.devdocs.json b/api_docs/kbn_shared_ux_link_redirect_app_mocks.devdocs.json index dded2ace4c3a2..64dc76155d112 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_link_redirect_app_mocks.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.StorybookMock", + "id": "def-common.StorybookMock", "type": "Class", "tags": [], "label": "StorybookMock", @@ -20,9 +28,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxLinkRedirectAppMocksPluginApi", - "section": "def-server.StorybookMock", + "section": "def-common.StorybookMock", "text": "StorybookMock" }, " extends ", @@ -36,7 +44,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.StorybookMock.propArguments", + "id": "def-common.StorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -47,7 +55,7 @@ }, { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.StorybookMock.serviceArguments", + "id": "def-common.StorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -58,7 +66,7 @@ }, { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.StorybookMock.dependencies", + "id": "def-common.StorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -71,7 +79,7 @@ }, { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.StorybookMock.getProps", + "id": "def-common.StorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -88,7 +96,7 @@ }, { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.StorybookMock.getServices", + "id": "def-common.StorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -110,24 +118,39 @@ "functions": [ { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.getRedirectAppLinksKibanaDependenciesMock", + "id": "def-common.getRedirectAppLinksKibanaDependenciesMock", "type": "Function", "tags": [], "label": "getRedirectAppLinksKibanaDependenciesMock", "description": [], "signature": [ - "() => ", + "(params?: Partial | undefined) => ", "RedirectAppLinksKibanaDependencies" ], "path": "packages/shared-ux/link/redirect_app/mocks/src/jest.ts", "deprecated": false, - "children": [], + "children": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", + "id": "def-common.getRedirectAppLinksKibanaDependenciesMock.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "Partial | undefined" + ], + "path": "packages/shared-ux/link/redirect_app/mocks/src/jest.ts", + "deprecated": false, + "isRequired": false + } + ], "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.getRedirectAppLinksServicesMock", + "id": "def-common.getRedirectAppLinksServicesMock", "type": "Function", "tags": [], "label": "getRedirectAppLinksServicesMock", @@ -135,12 +158,27 @@ "\nReturns the Jest-compatible service abstractions for the `NoDataCard` Provider." ], "signature": [ - "() => ", + "(params?: Partial | undefined) => ", "RedirectAppLinksServices" ], "path": "packages/shared-ux/link/redirect_app/mocks/src/jest.ts", "deprecated": false, - "children": [], + "children": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", + "id": "def-common.getRedirectAppLinksServicesMock.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "Partial | undefined" + ], + "path": "packages/shared-ux/link/redirect_app/mocks/src/jest.ts", + "deprecated": false, + "isRequired": false + } + ], "returnComment": [], "initialIsOpen": false } @@ -149,13 +187,5 @@ "enums": [], "misc": [], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx index c059b87f6242e..c0f40ecf5083f 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app-mocks title: "@kbn/shared-ux-link-redirect-app-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app-mocks'] --- import kbnSharedUxLinkRedirectAppMocksObj from './kbn_shared_ux_link_redirect_app_mocks.devdocs.json'; @@ -21,13 +21,13 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 8 | 0 | 7 | 0 | +| 10 | 0 | 9 | 0 | -## Server +## Common ### Functions - + ### Classes - + diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data.devdocs.json b/api_docs/kbn_shared_ux_page_analytics_no_data.devdocs.json index ed6fbf24bf21f..3f1e5a7afa895 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.devdocs.json +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.devdocs.json @@ -227,7 +227,13 @@ "signature": [ "KibanaDependencies", " & ", - "KibanaNoDataPageKibanaDependencies" + "KibanaDependencies", + " & ", + "NoDataViewsPromptKibanaDependencies", + " & ", + "KibanaDependencies", + " & ", + "RedirectAppLinksKibanaDependencies" ], "path": "node_modules/@kbn/shared-ux-page-analytics-no-data-types/index.d.ts", "deprecated": false, @@ -245,7 +251,13 @@ "signature": [ "Services", " & ", - "KibanaNoDataPageServices" + "Services", + " & ", + "Services", + " & ", + "RedirectAppLinksServices", + " & ", + "NoDataViewsPromptServices" ], "path": "node_modules/@kbn/shared-ux-page-analytics-no-data-types/index.d.ts", "deprecated": false, diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx index f4139225ddfd3..ee4897f052d57 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data title: "@kbn/shared-ux-page-analytics-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data'] --- import kbnSharedUxPageAnalyticsNoDataObj from './kbn_shared_ux_page_analytics_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json index 79c342c488de8..0ba419e7b51a0 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock", + "id": "def-common.StorybookMock", "type": "Class", "tags": [], "label": "StorybookMock", @@ -20,9 +28,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageAnalyticsNoDataMocksPluginApi", - "section": "def-server.StorybookMock", + "section": "def-common.StorybookMock", "text": "StorybookMock" }, " extends ", @@ -38,7 +46,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.propArguments", + "id": "def-common.StorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -49,7 +57,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments", + "id": "def-common.StorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -59,7 +67,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.kibanaGuideDocLink", + "id": "def-common.StorybookMock.serviceArguments.kibanaGuideDocLink", "type": "Object", "tags": [], "label": "kibanaGuideDocLink", @@ -69,7 +77,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.kibanaGuideDocLink.control", + "id": "def-common.StorybookMock.serviceArguments.kibanaGuideDocLink.control", "type": "string", "tags": [], "label": "control", @@ -79,7 +87,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.kibanaGuideDocLink.defaultValue", + "id": "def-common.StorybookMock.serviceArguments.kibanaGuideDocLink.defaultValue", "type": "string", "tags": [], "label": "defaultValue", @@ -93,7 +101,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.dependencies", + "id": "def-common.StorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -107,7 +115,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.getServices", + "id": "def-common.StorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -116,9 +124,9 @@ "(params: ", { "pluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageAnalyticsNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, ") => ", @@ -129,7 +137,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.getServices.$1", + "id": "def-common.StorybookMock.getServices.$1", "type": "CompoundType", "tags": [], "label": "params", @@ -137,9 +145,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageAnalyticsNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" } ], @@ -152,7 +160,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.getProps", + "id": "def-common.StorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -174,7 +182,7 @@ "functions": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.getServicesMock", + "id": "def-common.getServicesMock", "type": "Function", "tags": [], "label": "getServicesMock", @@ -195,7 +203,7 @@ "misc": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.Params", + "id": "def-common.Params", "type": "Type", "tags": [], "label": "Params", @@ -219,13 +227,5 @@ } ], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx index 1b62967580329..eafa4b4086e5a 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data-mocks title: "@kbn/shared-ux-page-analytics-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data-mocks'] --- import kbnSharedUxPageAnalyticsNoDataMocksObj from './kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json'; @@ -23,14 +23,14 @@ Contact [Owner missing] for questions regarding this plugin. |-------------------|-----------|------------------------|-----------------| | 12 | 0 | 12 | 0 | -## Server +## Common ### Functions - + ### Classes - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data.devdocs.json b/api_docs/kbn_shared_ux_page_kibana_no_data.devdocs.json index edef04f7c1f13..cd68f336f2217 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.devdocs.json +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.devdocs.json @@ -129,316 +129,54 @@ "initialIsOpen": false } ], - "interfaces": [ + "interfaces": [], + "enums": [], + "misc": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", "id": "def-common.KibanaNoDataPageKibanaDependencies", - "type": "Interface", + "type": "Type", "tags": [], "label": "KibanaNoDataPageKibanaDependencies", "description": [ "\nAn interface containing a collection of Kibana plugins and services required to\nrender this component and its dependencies." ], + "signature": [ + "KibanaDependencies", + " & ", + "NoDataViewsPromptKibanaDependencies", + " & ", + "KibanaDependencies", + " & ", + "RedirectAppLinksKibanaDependencies" + ], "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageKibanaDependencies.coreStart", - "type": "Object", - "tags": [], - "label": "coreStart", - "description": [], - "signature": [ - "{ application: { capabilities: { navLinks: Record; }; currentAppId$: ", - "Observable", - "; navigateToUrl: (url: string) => Promise; }; chrome: { setIsVisible: (isVisible: boolean) => void; }; docLinks: { links: { indexPatterns: { introduction: string; }; }; }; http: { basePath: { prepend: (url: string) => string; }; }; }" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageKibanaDependencies.dataViews", - "type": "Object", - "tags": [], - "label": "dataViews", - "description": [], - "signature": [ - "{ hasData: { hasDataView: () => Promise; hasESData: () => Promise; hasUserDataView: () => Promise; }; }" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageKibanaDependencies.dataViewEditor", - "type": "Object", - "tags": [], - "label": "dataViewEditor", - "description": [], - "signature": [ - "{ openEditor: (options: ", - "DataViewEditorOptions", - ") => () => void; userPermissions: { editDataView: () => boolean; }; }" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - } - ], "initialIsOpen": false }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", "id": "def-common.KibanaNoDataPageServices", - "type": "Interface", + "type": "Type", "tags": [], "label": "KibanaNoDataPageServices", "description": [ - "\nA list of Services that are consumed by this component.\n\nThis list is temporary, a stopgap as we migrate to a package-based architecture, where\nservices are not collected in a single package. In order to make the transition, this\ninterface is intentionally \"flat\".\n\nExpect this list to dwindle to zero as `@kbn/shared-ux-components` are migrated to their\nown packages, (and `@kbn/shared-ux-services` is removed)." + "\nA list of Services that are consumed by this component.." + ], + "signature": [ + "Services", + " & ", + "Services", + " & ", + "RedirectAppLinksServices", + " & ", + "NoDataViewsPromptServices" ], "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.hasESData", - "type": "Function", - "tags": [], - "label": "hasESData", - "description": [ - "True if the cluster contains data, false otherwise." - ], - "signature": [ - "() => Promise" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.hasUserDataView", - "type": "Function", - "tags": [], - "label": "hasUserDataView", - "description": [ - "True if Kibana instance contains user-created data view, false otherwise." - ], - "signature": [ - "() => Promise" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.addBasePath", - "type": "Function", - "tags": [], - "label": "addBasePath", - "description": [ - "Append the server base path to a relative URL." - ], - "signature": [ - "(url: string) => string" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.addBasePath.$1", - "type": "string", - "tags": [], - "label": "url", - "description": [], - "signature": [ - "string" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.canAccessFleet", - "type": "boolean", - "tags": [], - "label": "canAccessFleet", - "description": [ - "True if the user has permission to access Fleet, false otherwise." - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.canCreateNewDataView", - "type": "boolean", - "tags": [], - "label": "canCreateNewDataView", - "description": [ - "True if the user has permission to create a new Data View, false otherwise." - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.currentAppId$", - "type": "Object", - "tags": [], - "label": "currentAppId$", - "description": [ - "Observable storing the active, current application ID." - ], - "signature": [ - "Observable", - "" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.dataViewsDocLink", - "type": "string", - "tags": [], - "label": "dataViewsDocLink", - "description": [ - "A link to information about Data Views in Kibana" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.hasDataView", - "type": "Function", - "tags": [], - "label": "hasDataView", - "description": [ - "True if Kibana instance contains any data view, including system-created ones." - ], - "signature": [ - "() => Promise" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.navigateToUrl", - "type": "Function", - "tags": [], - "label": "navigateToUrl", - "description": [ - "Use Kibana to navigate async to a different URL." - ], - "signature": [ - "(url: string) => void | Promise" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.navigateToUrl.$1", - "type": "string", - "tags": [], - "label": "url", - "description": [], - "signature": [ - "string" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.openDataViewEditor", - "type": "Function", - "tags": [], - "label": "openDataViewEditor", - "description": [ - "A method to open the Data View Editor flow." - ], - "signature": [ - "(options: ", - "DataViewEditorOptions", - ") => () => void" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.openDataViewEditor.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - "DataViewEditorOptions" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.setIsFullscreen", - "type": "Function", - "tags": [], - "label": "setIsFullscreen", - "description": [ - "Set the Kibana chrome and browser to full screen mode." - ], - "signature": [ - "(isFullscreen: boolean) => void" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.setIsFullscreen.$1", - "type": "boolean", - "tags": [], - "label": "isFullscreen", - "description": [], - "signature": [ - "boolean" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], "initialIsOpen": false } ], - "enums": [], - "misc": [], "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx index 71478e6c156a8..9787dd1eb9e16 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data title: "@kbn/shared-ux-page-kibana-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data'] --- import kbnSharedUxPageKibanaNoDataObj from './kbn_shared_ux_page_kibana_no_data.devdocs.json'; @@ -21,13 +21,13 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 26 | 0 | 3 | 0 | +| 8 | 0 | 3 | 0 | ## Common ### Functions -### Interfaces - +### Consts, variables and types + diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json index dee03e2ae609e..e833987bc5068 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock", + "id": "def-common.StorybookMock", "type": "Class", "tags": [], "label": "StorybookMock", @@ -20,9 +28,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageKibanaNoDataMocksPluginApi", - "section": "def-server.StorybookMock", + "section": "def-common.StorybookMock", "text": "StorybookMock" }, " extends ", @@ -38,7 +46,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments", + "id": "def-common.StorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -48,7 +56,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.solution", + "id": "def-common.StorybookMock.propArguments.solution", "type": "Object", "tags": [], "label": "solution", @@ -58,7 +66,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.solution.control", + "id": "def-common.StorybookMock.propArguments.solution.control", "type": "string", "tags": [], "label": "control", @@ -68,7 +76,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.solution.defaultValue", + "id": "def-common.StorybookMock.propArguments.solution.defaultValue", "type": "string", "tags": [], "label": "defaultValue", @@ -80,7 +88,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.logo", + "id": "def-common.StorybookMock.propArguments.logo", "type": "Object", "tags": [], "label": "logo", @@ -90,7 +98,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.logo.control", + "id": "def-common.StorybookMock.propArguments.logo.control", "type": "Object", "tags": [], "label": "control", @@ -100,7 +108,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.logo.control.type", + "id": "def-common.StorybookMock.propArguments.logo.control.type", "type": "string", "tags": [], "label": "type", @@ -112,7 +120,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.logo.options", + "id": "def-common.StorybookMock.propArguments.logo.options", "type": "Array", "tags": [], "label": "options", @@ -125,7 +133,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.logo.defaultValue", + "id": "def-common.StorybookMock.propArguments.logo.defaultValue", "type": "Uncategorized", "tags": [], "label": "defaultValue", @@ -142,7 +150,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments", + "id": "def-common.StorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -152,7 +160,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.hasESData", + "id": "def-common.StorybookMock.serviceArguments.hasESData", "type": "Object", "tags": [], "label": "hasESData", @@ -162,7 +170,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.hasESData.control", + "id": "def-common.StorybookMock.serviceArguments.hasESData.control", "type": "string", "tags": [], "label": "control", @@ -172,7 +180,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.hasESData.defaultValue", + "id": "def-common.StorybookMock.serviceArguments.hasESData.defaultValue", "type": "boolean", "tags": [], "label": "defaultValue", @@ -184,7 +192,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.hasUserDataView", + "id": "def-common.StorybookMock.serviceArguments.hasUserDataView", "type": "Object", "tags": [], "label": "hasUserDataView", @@ -194,7 +202,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.hasUserDataView.control", + "id": "def-common.StorybookMock.serviceArguments.hasUserDataView.control", "type": "string", "tags": [], "label": "control", @@ -204,7 +212,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.hasUserDataView.defaultValue", + "id": "def-common.StorybookMock.serviceArguments.hasUserDataView.defaultValue", "type": "boolean", "tags": [], "label": "defaultValue", @@ -218,7 +226,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.dependencies", + "id": "def-common.StorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -235,7 +243,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.getProps", + "id": "def-common.StorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -244,9 +252,9 @@ "(params: ", { "pluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageKibanaNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, ") => { noDataConfig: { solution: any; logo: any; action: { elasticAgent: { title: string; }; }; docsLink: string; }; onDataViewCreated: ", @@ -258,7 +266,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.getProps.$1", + "id": "def-common.StorybookMock.getProps.$1", "type": "CompoundType", "tags": [], "label": "params", @@ -266,9 +274,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageKibanaNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" } ], @@ -281,7 +289,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.getServices", + "id": "def-common.StorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -290,9 +298,9 @@ "(params: ", { "pluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageKibanaNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, ") => ", @@ -303,7 +311,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.getServices.$1", + "id": "def-common.StorybookMock.getServices.$1", "type": "CompoundType", "tags": [], "label": "params", @@ -311,9 +319,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageKibanaNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" } ], @@ -331,7 +339,7 @@ "functions": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.getServicesMock", + "id": "def-common.getServicesMock", "type": "Function", "tags": [], "label": "getServicesMock", @@ -339,9 +347,7 @@ "\nReturns the Jest-compatible service abstractions for the `KibanaNoDataPage` Provider." ], "signature": [ - "(params?: ", - "MockServicesFactoryParams", - " | undefined) => ", + "(params?: Partial | undefined) => ", "KibanaNoDataPageServices" ], "path": "packages/shared-ux/page/kibana_no_data/mocks/src/jest.ts", @@ -349,14 +355,13 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.getServicesMock.$1", + "id": "def-common.getServicesMock.$1", "type": "Object", "tags": [], "label": "params", "description": [], "signature": [ - "MockServicesFactoryParams", - " | undefined" + "Partial | undefined" ], "path": "packages/shared-ux/page/kibana_no_data/mocks/src/jest.ts", "deprecated": false, @@ -372,7 +377,7 @@ "misc": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.Params", + "id": "def-common.Params", "type": "Type", "tags": [], "label": "Params", @@ -390,13 +395,5 @@ } ], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx index 0085b7143619c..c66936ac53795 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data-mocks title: "@kbn/shared-ux-page-kibana-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data-mocks'] --- import kbnSharedUxPageKibanaNoDataMocksObj from './kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json'; @@ -23,14 +23,14 @@ Contact [Owner missing] for questions regarding this plugin. |-------------------|-----------|------------------------|-----------------| | 25 | 0 | 24 | 0 | -## Server +## Common ### Functions - + ### Classes - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_page_kibana_template.devdocs.json b/api_docs/kbn_shared_ux_page_kibana_template.devdocs.json new file mode 100644 index 0000000000000..f8cdca8122258 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_kibana_template.devdocs.json @@ -0,0 +1,218 @@ +{ + "id": "@kbn/shared-ux-page-kibana-template", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplate", + "type": "Function", + "tags": [], + "label": "KibanaPageTemplate", + "description": [], + "signature": [ + "({ template, className, children, solutionNav, noDataConfig, ...rest }: React.PropsWithChildren<", + "KibanaPageTemplateProps", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/kibana_template/impl/src/page_template.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplate.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n template,\n className,\n children,\n solutionNav,\n noDataConfig,\n ...rest\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "KibanaPageTemplateProps", + ">" + ], + "path": "packages/shared-ux/page/kibana_template/impl/src/page_template.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateKibanaProvider", + "type": "Function", + "tags": [], + "label": "KibanaPageTemplateKibanaProvider", + "description": [ + "\nKibana-specific Provider that maps dependencies to services." + ], + "signature": [ + "({ children, ...dependencies }: React.PropsWithChildren<", + "NoDataCardKibanaDependencies", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/kibana_template/impl/src/services.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateKibanaProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...dependencies\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "NoDataCardKibanaDependencies", + ">" + ], + "path": "packages/shared-ux/page/kibana_template/impl/src/services.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateProvider", + "type": "Function", + "tags": [], + "label": "KibanaPageTemplateProvider", + "description": [ + "\nA Context Provider that provides services to the component and its dependencies." + ], + "signature": [ + "({ children, ...services }: React.PropsWithChildren<", + "NoDataCardServices", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/kibana_template/impl/src/services.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...services\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "NoDataCardServices", + ">" + ], + "path": "packages/shared-ux/page/kibana_template/impl/src/services.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateKibanaDependencies", + "type": "Type", + "tags": [], + "label": "KibanaPageTemplateKibanaDependencies", + "description": [], + "signature": [ + "KibanaDependencies", + " & ", + "RedirectAppLinksKibanaDependencies" + ], + "path": "node_modules/@kbn/shared-ux-page-kibana-template-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateProps", + "type": "Type", + "tags": [], + "label": "KibanaPageTemplateProps", + "description": [], + "signature": [ + "Omit<", + "EuiPageProps", + ", \"paddingSize\"> & { template?: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\" | undefined; paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", + "EuiPageSideBarProps", + " | undefined; pageHeader?: ", + "EuiPageHeaderProps", + " | undefined; pageBodyProps?: ", + "EuiPageBodyProps", + "<\"main\"> | undefined; pageContentProps?: ", + "EuiPageContentProps", + " | undefined; pageContentBodyProps?: ", + "EuiPageContentBodyProps", + " | undefined; bottomBar?: React.ReactNode; bottomBarProps?: ", + "EuiBottomBarProps", + " | undefined; fullHeight?: boolean | \"noscroll\" | undefined; minHeight?: ", + "Property", + ".MinHeight | undefined; } & { isEmptyState?: boolean | undefined; solutionNav?: ", + "SolutionNavProps", + " | undefined; noDataConfig?: ", + "NoDataPageProps", + " | undefined; }" + ], + "path": "node_modules/@kbn/shared-ux-page-kibana-template-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateServices", + "type": "Type", + "tags": [], + "label": "KibanaPageTemplateServices", + "description": [], + "signature": [ + "Services", + " & ", + "RedirectAppLinksServices" + ], + "path": "node_modules/@kbn/shared-ux-page-kibana-template-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.NoDataConfig", + "type": "Type", + "tags": [], + "label": "NoDataConfig", + "description": [], + "signature": [ + "NoDataPageProps" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-config-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_kibana_template.mdx b/api_docs/kbn_shared_ux_page_kibana_template.mdx new file mode 100644 index 0000000000000..9d642801a41d8 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_kibana_template.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnSharedUxPageKibanaTemplatePluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template +title: "@kbn/shared-ux-page-kibana-template" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/shared-ux-page-kibana-template plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template'] +--- +import kbnSharedUxPageKibanaTemplateObj from './kbn_shared_ux_page_kibana_template.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 10 | 0 | 4 | 0 | + +## Server + +### Functions + + +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_page_kibana_template_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_kibana_template_mocks.devdocs.json new file mode 100644 index 0000000000000..5e888519540f0 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_kibana_template_mocks.devdocs.json @@ -0,0 +1,860 @@ +{ + "id": "@kbn/shared-ux-page-kibana-template-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock", + "type": "Class", + "tags": [], + "label": "StorybookMock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, + " extends ", + "AbstractStorybookMock", + "<", + "KibanaPageTemplateProps", + ", ", + "NoDataCardServices", + ", PropArguments, {}>" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments", + "type": "Object", + "tags": [], + "label": "propArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.serviceArguments", + "type": "Object", + "tags": [], + "label": "serviceArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "children": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.dependencies", + "type": "Array", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + "NoDataConfigPageStorybookMock", + "[]" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps", + "type": "Function", + "tags": [], + "label": "getProps", + "description": [], + "signature": [ + "(params?: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined) => ", + "KibanaPageTemplateProps" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices", + "type": "Function", + "tags": [], + "label": "getServices", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + ") => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock", + "type": "Class", + "tags": [], + "label": "StorybookMock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, + " extends ", + "AbstractStorybookMock", + "<", + "KibanaPageTemplateProps", + ", ", + "NoDataCardServices", + ", ", + "NoDataConfigArguments", + ", {}>" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments", + "type": "Object", + "tags": [], + "label": "propArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.serviceArguments", + "type": "Object", + "tags": [], + "label": "serviceArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "children": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.dependencies", + "type": "Array", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + "NoDataConfigPageStorybookMock", + "[]" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps", + "type": "Function", + "tags": [], + "label": "getProps", + "description": [], + "signature": [ + "(params?: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined) => ", + "KibanaPageTemplateProps" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices", + "type": "Function", + "tags": [], + "label": "getServices", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + ") => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock", + "type": "Class", + "tags": [], + "label": "StorybookMock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, + " extends ", + "AbstractStorybookMock", + "<", + "KibanaPageTemplateProps", + ", ", + "NoDataCardServices", + ", ", + "SolutionNavArguments", + ", {}>" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments", + "type": "Object", + "tags": [], + "label": "propArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.serviceArguments", + "type": "Object", + "tags": [], + "label": "serviceArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "children": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.dependencies", + "type": "Array", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + "NoDataConfigPageStorybookMock", + "[]" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps", + "type": "Function", + "tags": [], + "label": "getProps", + "description": [], + "signature": [ + "(params?: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined) => ", + "KibanaPageTemplateProps" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices", + "type": "Function", + "tags": [], + "label": "getServices", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + ") => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock", + "type": "Class", + "tags": [], + "label": "StorybookMock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, + " extends ", + "AbstractStorybookMock", + "<", + "KibanaPageTemplateProps", + ", ", + "NoDataCardServices", + ", PropArguments, {}>" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments", + "type": "Object", + "tags": [], + "label": "propArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.serviceArguments", + "type": "Object", + "tags": [], + "label": "serviceArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "children": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.dependencies", + "type": "Array", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + "never[]" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps", + "type": "Function", + "tags": [], + "label": "getProps", + "description": [], + "signature": [ + "(params?: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined) => ", + "KibanaPageTemplateProps" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices", + "type": "Function", + "tags": [], + "label": "getServices", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + ") => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.getKibanaDependenciesMock", + "type": "Function", + "tags": [], + "label": "getKibanaDependenciesMock", + "description": [], + "signature": [ + "() => ", + "NoDataCardKibanaDependencies" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/jest.ts", + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.getServicesMock", + "type": "Function", + "tags": [], + "label": "getServicesMock", + "description": [], + "signature": [ + "() => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/jest.ts", + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.Params", + "type": "Type", + "tags": [], + "label": "Params", + "description": [], + "signature": [ + "ArgumentParams", + " & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "NoDataCardStorybookParams" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.Params", + "type": "Type", + "tags": [], + "label": "Params", + "description": [], + "signature": [ + "ArgumentParams", + "<", + "NoDataConfigArguments", + ", {}> & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "NoDataCardStorybookParams" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.Params", + "type": "Type", + "tags": [], + "label": "Params", + "description": [], + "signature": [ + "ArgumentParams", + "<", + "SolutionNavArguments", + ", {}> & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "NoDataCardStorybookParams" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.Params", + "type": "Type", + "tags": [], + "label": "Params", + "description": [], + "signature": [ + "ArgumentParams", + " & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "NoDataCardStorybookParams" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx new file mode 100644 index 0000000000000..5e33f8c616dbe --- /dev/null +++ b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx @@ -0,0 +1,36 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnSharedUxPageKibanaTemplateMocksPluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template-mocks +title: "@kbn/shared-ux-page-kibana-template-mocks" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/shared-ux-page-kibana-template-mocks plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template-mocks'] +--- +import kbnSharedUxPageKibanaTemplateMocksObj from './kbn_shared_ux_page_kibana_template_mocks.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 43 | 5 | 43 | 2 | + +## Common + +### Functions + + +### Classes + + +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_page_no_data.devdocs.json b/api_docs/kbn_shared_ux_page_no_data.devdocs.json new file mode 100644 index 0000000000000..b67afdf6a138c --- /dev/null +++ b/api_docs/kbn_shared_ux_page_no_data.devdocs.json @@ -0,0 +1,247 @@ +{ + "id": "@kbn/shared-ux-page-no-data", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPage", + "type": "Function", + "tags": [], + "label": "NoDataPage", + "description": [], + "signature": [ + "({ solution, logo, action, docsLink, pageTitle, className, }: ", + "NoDataPageProps", + ") => JSX.Element" + ], + "path": "packages/shared-ux/page/no_data/impl/src/no_data_page.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPage.$1", + "type": "Object", + "tags": [], + "label": "{\n solution,\n logo,\n action,\n docsLink,\n pageTitle,\n className,\n}", + "description": [], + "signature": [ + "NoDataPageProps" + ], + "path": "packages/shared-ux/page/no_data/impl/src/no_data_page.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageKibanaProvider", + "type": "Function", + "tags": [], + "label": "NoDataPageKibanaProvider", + "description": [ + "\nKibana-specific Provider that maps dependencies to services." + ], + "signature": [ + "({ children, ...dependencies }: React.PropsWithChildren<", + "NoDataCardKibanaDependencies", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/no_data/impl/src/services.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageKibanaProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...dependencies\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "NoDataCardKibanaDependencies", + ">" + ], + "path": "packages/shared-ux/page/no_data/impl/src/services.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProvider", + "type": "Function", + "tags": [], + "label": "NoDataPageProvider", + "description": [ + "\nA Context Provider that provides services to the component and its dependencies." + ], + "signature": [ + "({ children, ...services }: React.PropsWithChildren<", + "NoDataCardServices", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/no_data/impl/src/services.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{ children, ...services }", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "NoDataCardServices", + ">" + ], + "path": "packages/shared-ux/page/no_data/impl/src/services.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProps", + "type": "Interface", + "tags": [], + "label": "NoDataPageProps", + "description": [], + "signature": [ + "NoDataPageProps", + " extends ", + "CommonProps", + ",", + "ActionCardProps" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProps.solution", + "type": "string", + "tags": [], + "label": "solution", + "description": [ + "\nSingle name for the current solution, used to auto-generate the title, logo, description, and button label" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProps.docsLink", + "type": "string", + "tags": [], + "label": "docsLink", + "description": [ + "\nRequired to set the docs link for the whole solution" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProps.logo", + "type": "string", + "tags": [], + "label": "logo", + "description": [ + "\nOptionally replace the auto-generated logo" + ], + "signature": [ + "string | undefined" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProps.pageTitle", + "type": "string", + "tags": [], + "label": "pageTitle", + "description": [ + "\nOptionally replace the auto-generated page title (h1)" + ], + "signature": [ + "string | undefined" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageKibanaDependencies", + "type": "Type", + "tags": [], + "label": "NoDataPageKibanaDependencies", + "description": [ + "\nAn interface containing a collection of Kibana plugins and services required to\nrender this component." + ], + "signature": [ + "KibanaDependencies", + " & ", + "RedirectAppLinksKibanaDependencies" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageServices", + "type": "Type", + "tags": [], + "label": "NoDataPageServices", + "description": [ + "\nA list of services that are consumed by this component." + ], + "signature": [ + "Services", + " & ", + "RedirectAppLinksServices" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_components.mdx b/api_docs/kbn_shared_ux_page_no_data.mdx similarity index 54% rename from api_docs/kbn_shared_ux_components.mdx rename to api_docs/kbn_shared_ux_page_no_data.mdx index 9bbeb30d72357..b827c909c6d39 100644 --- a/api_docs/kbn_shared_ux_components.mdx +++ b/api_docs/kbn_shared_ux_page_no_data.mdx @@ -3,15 +3,15 @@ #### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. #### Reach out in #docs-engineering for more info. #### -id: kibKbnSharedUxComponentsPluginApi -slug: /kibana-dev-docs/api/kbn-shared-ux-components -title: "@kbn/shared-ux-components" +id: kibKbnSharedUxPageNoDataPluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data +title: "@kbn/shared-ux-page-no-data" image: https://source.unsplash.com/400x175/?github -description: API docs for the @kbn/shared-ux-components plugin -date: 2022-08-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-components'] +description: API docs for the @kbn/shared-ux-page-no-data plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data'] --- -import kbnSharedUxComponentsObj from './kbn_shared_ux_components.devdocs.json'; +import kbnSharedUxPageNoDataObj from './kbn_shared_ux_page_no_data.devdocs.json'; @@ -21,16 +21,16 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 11 | 0 | 6 | 0 | +| 13 | 0 | 4 | 0 | ## Common ### Functions - + ### Interfaces - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_page_no_data_config.devdocs.json b/api_docs/kbn_shared_ux_page_no_data_config.devdocs.json new file mode 100644 index 0000000000000..33b90569d9d4e --- /dev/null +++ b/api_docs/kbn_shared_ux_page_no_data_config.devdocs.json @@ -0,0 +1,254 @@ +{ + "id": "@kbn/shared-ux-page-no-data-config", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPage", + "type": "Function", + "tags": [], + "label": "NoDataConfigPage", + "description": [], + "signature": [ + "(props: ", + "NoDataConfigPageProps", + ") => JSX.Element | null" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPage.$1", + "type": "CompoundType", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "NoDataConfigPageProps" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageKibanaProvider", + "type": "Function", + "tags": [], + "label": "NoDataConfigPageKibanaProvider", + "description": [ + "\nKibana-specific Provider that maps dependencies to services." + ], + "signature": [ + "({ children, ...dependencies }: React.PropsWithChildren<", + "NoDataCardKibanaDependencies", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/services.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageKibanaProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...dependencies\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "NoDataCardKibanaDependencies", + ">" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/services.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageProvider", + "type": "Function", + "tags": [], + "label": "NoDataConfigPageProvider", + "description": [ + "\nA Context Provider that provides services to the component and its dependencies." + ], + "signature": [ + "({ children, ...services }: React.PropsWithChildren<", + "NoDataCardServices", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/services.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...services\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "NoDataCardServices", + ">" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/services.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageWithSolutionNavBar", + "type": "Function", + "tags": [], + "label": "NoDataConfigPageWithSolutionNavBar", + "description": [], + "signature": [ + "{ (props: ", + "Props", + " & { template?: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\" | undefined; paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", + "EuiPageSideBarProps", + " | undefined; pageHeader?: ", + "EuiPageHeaderProps", + " | undefined; pageBodyProps?: ", + "EuiPageBodyProps", + "<\"main\"> | undefined; pageContentProps?: ", + "EuiPageContentProps", + " | undefined; pageContentBodyProps?: ", + "EuiPageContentBodyProps", + " | undefined; bottomBar?: React.ReactNode; bottomBarProps?: ", + "EuiBottomBarProps", + " | undefined; fullHeight?: boolean | \"noscroll\" | undefined; minHeight?: ", + "Property", + ".MinHeight | undefined; } & { noDataConfig?: ", + "NoDataPageProps", + " | undefined; }>): JSX.Element; displayName: string; }" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageWithSolutionNavBar.$1", + "type": "CompoundType", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "P & ", + "TemplateProps", + " & { isEmptyState?: boolean | undefined; } & { solutionNav: ", + "SolutionNavProps", + "; }" + ], + "path": "node_modules/@types/kbn__shared-ux-page-solution-nav/index.d.ts", + "deprecated": false + } + ], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageKibanaDependencies", + "type": "Type", + "tags": [], + "label": "NoDataConfigPageKibanaDependencies", + "description": [], + "signature": [ + "KibanaDependencies", + " & ", + "RedirectAppLinksKibanaDependencies" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-config-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageProps", + "type": "Type", + "tags": [], + "label": "NoDataConfigPageProps", + "description": [], + "signature": [ + "Omit<", + "EuiPageProps", + ", \"paddingSize\"> & { template?: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\" | undefined; paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", + "EuiPageSideBarProps", + " | undefined; pageHeader?: ", + "EuiPageHeaderProps", + " | undefined; pageBodyProps?: ", + "EuiPageBodyProps", + "<\"main\"> | undefined; pageContentProps?: ", + "EuiPageContentProps", + " | undefined; pageContentBodyProps?: ", + "EuiPageContentBodyProps", + " | undefined; bottomBar?: React.ReactNode; bottomBarProps?: ", + "EuiBottomBarProps", + " | undefined; fullHeight?: boolean | \"noscroll\" | undefined; minHeight?: ", + "Property", + ".MinHeight | undefined; } & { noDataConfig?: ", + "NoDataPageProps", + " | undefined; }" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-config-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageServices", + "type": "Type", + "tags": [], + "label": "NoDataConfigPageServices", + "description": [], + "signature": [ + "Services", + " & ", + "RedirectAppLinksServices" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-config-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_storybook.mdx b/api_docs/kbn_shared_ux_page_no_data_config.mdx similarity index 50% rename from api_docs/kbn_shared_ux_storybook.mdx rename to api_docs/kbn_shared_ux_page_no_data_config.mdx index fbaf2ca1b1c51..3c32b0e7d5672 100644 --- a/api_docs/kbn_shared_ux_storybook.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config.mdx @@ -3,15 +3,15 @@ #### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. #### Reach out in #docs-engineering for more info. #### -id: kibKbnSharedUxStorybookPluginApi -slug: /kibana-dev-docs/api/kbn-shared-ux-storybook -title: "@kbn/shared-ux-storybook" +id: kibKbnSharedUxPageNoDataConfigPluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config +title: "@kbn/shared-ux-page-no-data-config" image: https://source.unsplash.com/400x175/?github -description: API docs for the @kbn/shared-ux-storybook plugin -date: 2022-08-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook'] +description: API docs for the @kbn/shared-ux-page-no-data-config plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config'] --- -import kbnSharedUxStorybookObj from './kbn_shared_ux_storybook.devdocs.json'; +import kbnSharedUxPageNoDataConfigObj from './kbn_shared_ux_page_no_data_config.devdocs.json'; @@ -21,13 +21,13 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 16 | 0 | 7 | 0 | +| 11 | 0 | 5 | 0 | ## Common ### Functions - + -### Interfaces - +### Consts, variables and types + diff --git a/api_docs/kbn_shared_ux_page_no_data_config_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_no_data_config_mocks.devdocs.json new file mode 100644 index 0000000000000..9cff904b1bb17 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_no_data_config_mocks.devdocs.json @@ -0,0 +1,380 @@ +{ + "id": "@kbn/shared-ux-page-no-data-config-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock", + "type": "Class", + "tags": [], + "label": "NoDataConfigPageStorybookMock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.NoDataConfigPageStorybookMock", + "text": "NoDataConfigPageStorybookMock" + }, + " extends ", + "AbstractStorybookMock", + "<", + "NoDataConfigPageProps", + ", ", + "NoDataCardServices", + ", PropArguments, {}>" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments", + "type": "Object", + "tags": [], + "label": "propArguments", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.solution", + "type": "Object", + "tags": [], + "label": "solution", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.solution.control", + "type": "string", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.solution.defaultValue", + "type": "string", + "tags": [], + "label": "defaultValue", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.logo", + "type": "Object", + "tags": [], + "label": "logo", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.logo.control", + "type": "Object", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.logo.control.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.logo.options", + "type": "Array", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "(string | undefined)[]" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.logo.defaultValue", + "type": "Uncategorized", + "tags": [], + "label": "defaultValue", + "description": [], + "signature": [ + "undefined" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.docsLink", + "type": "Object", + "tags": [], + "label": "docsLink", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.docsLink.control", + "type": "string", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.docsLink.defaultValue", + "type": "string", + "tags": [], + "label": "defaultValue", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.pageTitle", + "type": "Object", + "tags": [], + "label": "pageTitle", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.pageTitle.control", + "type": "string", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.pageTitle.defaultValue", + "type": "string", + "tags": [], + "label": "defaultValue", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + } + ] + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.serviceArguments", + "type": "Object", + "tags": [], + "label": "serviceArguments", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.dependencies", + "type": "Array", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + "NoDataPageStorybookMock", + "[]" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.getProps", + "type": "Function", + "tags": [], + "label": "getProps", + "description": [], + "signature": [ + "(params?: ", + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined) => ", + "NoDataConfigPageProps" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.getProps.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.getServices", + "type": "Function", + "tags": [], + "label": "getServices", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + ") => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.getServices.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.getServicesMock", + "type": "Function", + "tags": [], + "label": "getServicesMock", + "description": [], + "signature": [ + "() => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/jest.ts", + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.Params", + "type": "Type", + "tags": [], + "label": "Params", + "description": [], + "signature": [ + "ArgumentParams", + " & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "NoDataCardStorybookParams" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx new file mode 100644 index 0000000000000..b498e172e6b32 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx @@ -0,0 +1,36 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnSharedUxPageNoDataConfigMocksPluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config-mocks +title: "@kbn/shared-ux-page-no-data-config-mocks" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/shared-ux-page-no-data-config-mocks plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config-mocks'] +--- +import kbnSharedUxPageNoDataConfigMocksObj from './kbn_shared_ux_page_no_data_config_mocks.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 24 | 0 | 24 | 0 | + +## Common + +### Functions + + +### Classes + + +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_page_no_data_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_no_data_mocks.devdocs.json new file mode 100644 index 0000000000000..76c026ad3a55d --- /dev/null +++ b/api_docs/kbn_shared_ux_page_no_data_mocks.devdocs.json @@ -0,0 +1,433 @@ +{ + "id": "@kbn/shared-ux-page-no-data-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock", + "type": "Class", + "tags": [], + "label": "NoDataPageStorybookMock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataMocksPluginApi", + "section": "def-common.NoDataPageStorybookMock", + "text": "NoDataPageStorybookMock" + }, + " extends ", + "AbstractStorybookMock", + "<", + "NoDataPageProps", + ", ", + "NoDataCardServices", + ", PropArguments, {}>" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments", + "type": "Object", + "tags": [], + "label": "propArguments", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.solution", + "type": "Object", + "tags": [], + "label": "solution", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.solution.control", + "type": "string", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.solution.defaultValue", + "type": "string", + "tags": [], + "label": "defaultValue", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.logo", + "type": "Object", + "tags": [], + "label": "logo", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.logo.control", + "type": "Object", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.logo.control.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.logo.options", + "type": "Array", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "(string | undefined)[]" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.logo.defaultValue", + "type": "Uncategorized", + "tags": [], + "label": "defaultValue", + "description": [], + "signature": [ + "undefined" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.docsLink", + "type": "Object", + "tags": [], + "label": "docsLink", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.docsLink.control", + "type": "string", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.docsLink.defaultValue", + "type": "string", + "tags": [], + "label": "defaultValue", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.pageTitle", + "type": "Object", + "tags": [], + "label": "pageTitle", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.pageTitle.control", + "type": "string", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.pageTitle.defaultValue", + "type": "string", + "tags": [], + "label": "defaultValue", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + } + ] + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.serviceArguments", + "type": "Object", + "tags": [], + "label": "serviceArguments", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.dependencies", + "type": "Array", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + "NoDataCardStorybookMock", + "[]" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.getProps", + "type": "Function", + "tags": [], + "label": "getProps", + "description": [], + "signature": [ + "(params?: ", + { + "pluginId": "@kbn/shared-ux-page-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined) => ", + "NoDataPageProps" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.getProps.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.getServices", + "type": "Function", + "tags": [], + "label": "getServices", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/shared-ux-page-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + ") => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.getServices.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.getKibanaDependenciesMock", + "type": "Function", + "tags": [], + "label": "getKibanaDependenciesMock", + "description": [ + "\nReturn a Jest mock of the Kibana dependencies for the `NoDataPageKibanaProvider`." + ], + "signature": [ + "(params?: Partial<", + "NoDataCardServices", + ">) => ", + "NoDataCardKibanaDependencies" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/jest.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.getKibanaDependenciesMock.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "Partial<", + "NoDataCardServices", + ">" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/jest.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.getServicesMock", + "type": "Function", + "tags": [], + "label": "getServicesMock", + "description": [], + "signature": [ + "(params?: Partial<", + "NoDataCardServices", + ">) => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/jest.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.getServicesMock.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "Partial<", + "NoDataCardServices", + ">" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/jest.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.Params", + "type": "Type", + "tags": [], + "label": "Params", + "description": [], + "signature": [ + "ArgumentParams", + " & ", + "NoDataCardStorybookParams" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx new file mode 100644 index 0000000000000..6254e19d57a76 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx @@ -0,0 +1,36 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnSharedUxPageNoDataMocksPluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-mocks +title: "@kbn/shared-ux-page-no-data-mocks" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/shared-ux-page-no-data-mocks plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-mocks'] +--- +import kbnSharedUxPageNoDataMocksObj from './kbn_shared_ux_page_no_data_mocks.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 27 | 0 | 26 | 0 | + +## Common + +### Functions + + +### Classes + + +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_page_solution_nav.mdx b/api_docs/kbn_shared_ux_page_solution_nav.mdx index 7c11ac54b5efb..9057266d79f40 100644 --- a/api_docs/kbn_shared_ux_page_solution_nav.mdx +++ b/api_docs/kbn_shared_ux_page_solution_nav.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-solution-nav title: "@kbn/shared-ux-page-solution-nav" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-solution-nav plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-solution-nav'] --- import kbnSharedUxPageSolutionNavObj from './kbn_shared_ux_page_solution_nav.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.devdocs.json b/api_docs/kbn_shared_ux_prompt_no_data_views.devdocs.json index 3c2025f7d0d9e..6b323a41bb51d 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.devdocs.json +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.devdocs.json @@ -100,7 +100,7 @@ ], "signature": [ "({ children, ...services }: React.PropsWithChildren<", - "NoDataViewsPromptKibanaServices", + "NoDataViewsPromptKibanaDependencies", ">) => JSX.Element" ], "path": "packages/shared-ux/prompt/no_data_views/impl/src/services.tsx", @@ -115,7 +115,7 @@ "description": [], "signature": [ "React.PropsWithChildren<", - "NoDataViewsPromptKibanaServices", + "NoDataViewsPromptKibanaDependencies", ">" ], "path": "packages/shared-ux/prompt/no_data_views/impl/src/services.tsx", @@ -229,7 +229,7 @@ "The background color of the prompt; defaults to `plain`." ], "signature": [ - "\"warning\" | \"primary\" | \"success\" | \"accent\" | \"danger\" | \"subdued\" | \"transparent\" | \"plain\" | undefined" + "\"warning\" | \"subdued\" | \"primary\" | \"accent\" | \"success\" | \"danger\" | \"transparent\" | \"plain\" | undefined" ], "path": "node_modules/@kbn/shared-ux-prompt-no-data-views-types/index.d.ts", "deprecated": false @@ -239,10 +239,10 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views", - "id": "def-common.NoDataViewsPromptKibanaServices", + "id": "def-common.NoDataViewsPromptKibanaDependencies", "type": "Interface", "tags": [], - "label": "NoDataViewsPromptKibanaServices", + "label": "NoDataViewsPromptKibanaDependencies", "description": [ "\nKibana-specific service types." ], @@ -251,7 +251,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views", - "id": "def-common.NoDataViewsPromptKibanaServices.coreStart", + "id": "def-common.NoDataViewsPromptKibanaDependencies.coreStart", "type": "Object", "tags": [], "label": "coreStart", @@ -264,7 +264,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views", - "id": "def-common.NoDataViewsPromptKibanaServices.dataViewEditor", + "id": "def-common.NoDataViewsPromptKibanaDependencies.dataViewEditor", "type": "Object", "tags": [], "label": "dataViewEditor", diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx index 8a51828b370d9..7385ebf756065 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views title: "@kbn/shared-ux-prompt-no-data-views" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views'] --- import kbnSharedUxPromptNoDataViewsObj from './kbn_shared_ux_prompt_no_data_views.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json index 33f49ec84b7fa..6ce6b2d959557 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock", + "id": "def-common.StorybookMock", "type": "Class", "tags": [], "label": "StorybookMock", @@ -20,9 +28,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPromptNoDataViewsMocksPluginApi", - "section": "def-server.StorybookMock", + "section": "def-common.StorybookMock", "text": "StorybookMock" }, " extends ", @@ -38,7 +46,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.propArguments", + "id": "def-common.StorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -49,7 +57,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments", + "id": "def-common.StorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -59,7 +67,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.canCreateNewDataView", + "id": "def-common.StorybookMock.serviceArguments.canCreateNewDataView", "type": "Object", "tags": [], "label": "canCreateNewDataView", @@ -69,7 +77,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.canCreateNewDataView.control", + "id": "def-common.StorybookMock.serviceArguments.canCreateNewDataView.control", "type": "string", "tags": [], "label": "control", @@ -79,7 +87,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.canCreateNewDataView.defaultValue", + "id": "def-common.StorybookMock.serviceArguments.canCreateNewDataView.defaultValue", "type": "boolean", "tags": [], "label": "defaultValue", @@ -91,7 +99,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.dataViewsDocLink", + "id": "def-common.StorybookMock.serviceArguments.dataViewsDocLink", "type": "Object", "tags": [], "label": "dataViewsDocLink", @@ -101,7 +109,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.dataViewsDocLink.options", + "id": "def-common.StorybookMock.serviceArguments.dataViewsDocLink.options", "type": "Array", "tags": [], "label": "options", @@ -114,7 +122,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.dataViewsDocLink.control", + "id": "def-common.StorybookMock.serviceArguments.dataViewsDocLink.control", "type": "Object", "tags": [], "label": "control", @@ -124,7 +132,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.dataViewsDocLink.control.type", + "id": "def-common.StorybookMock.serviceArguments.dataViewsDocLink.control.type", "type": "string", "tags": [], "label": "type", @@ -140,7 +148,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.dependencies", + "id": "def-common.StorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -153,7 +161,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.getProps", + "id": "def-common.StorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -170,7 +178,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.getServices", + "id": "def-common.StorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -179,9 +187,9 @@ "(params: ", { "pluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPromptNoDataViewsMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, ") => ", @@ -192,7 +200,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.getServices.$1", + "id": "def-common.StorybookMock.getServices.$1", "type": "Object", "tags": [], "label": "params", @@ -200,9 +208,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPromptNoDataViewsMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" } ], @@ -220,7 +228,7 @@ "functions": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.getNoDataViewsPromptServicesMock", + "id": "def-common.getNoDataViewsPromptServicesMock", "type": "Function", "tags": [], "label": "getNoDataViewsPromptServicesMock", @@ -238,7 +246,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.getNoDataViewsPromptServicesMock.$1", + "id": "def-common.getNoDataViewsPromptServicesMock.$1", "type": "Object", "tags": [], "label": "params", @@ -262,7 +270,7 @@ "misc": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.Params", + "id": "def-common.Params", "type": "Type", "tags": [], "label": "Params", @@ -276,13 +284,5 @@ } ], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx index 4f61527d6d394..945f8088d3827 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views-mocks title: "@kbn/shared-ux-prompt-no-data-views-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views-mocks plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views-mocks'] --- import kbnSharedUxPromptNoDataViewsMocksObj from './kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json'; @@ -23,14 +23,14 @@ Contact [Owner missing] for questions regarding this plugin. |-------------------|-----------|------------------------|-----------------| | 17 | 0 | 16 | 0 | -## Server +## Common ### Functions - + ### Classes - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_services.devdocs.json b/api_docs/kbn_shared_ux_services.devdocs.json deleted file mode 100644 index b608a43ecc744..0000000000000 --- a/api_docs/kbn_shared_ux_services.devdocs.json +++ /dev/null @@ -1,1568 +0,0 @@ -{ - "id": "@kbn/shared-ux-services", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServicesFactory", - "type": "Function", - "tags": [], - "label": "mockServicesFactory", - "description": [ - "\nA factory function for creating a Jest-based implementation of `SharedUxServices`." - ], - "signature": [ - "(params?: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.MockServicesFactoryParams", - "text": "MockServicesFactoryParams" - }, - " | undefined) => { application: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxApplicationService", - "text": "SharedUxApplicationService" - }, - "; docLinks: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDocLinksService", - "text": "SharedUxDocLinksService" - }, - "; editors: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxEditorsService", - "text": "SharedUxEditorsService" - }, - "; http: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxHttpService", - "text": "SharedUxHttpService" - }, - "; permissions: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxUserPermissionsService", - "text": "SharedUxUserPermissionsService" - }, - "; platform: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxPlatformService", - "text": "SharedUxPlatformService" - }, - "; data: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDataService", - "text": "SharedUxDataService" - }, - "; }" - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServicesFactory.$1", - "type": "Object", - "tags": [], - "label": "params", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.MockServicesFactoryParams", - "text": "MockServicesFactoryParams" - }, - " | undefined" - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServicesProvider", - "type": "Function", - "tags": [], - "label": "SharedUxServicesProvider", - "description": [ - "\nThe `React.Context` Provider component for the `SharedUxServices` context. Any\nplugin or environment that consumes SharedUX components needs to wrap their React\ntree with this provider.\n\nWithin a plugin, you can use use the Shared UX plugin and retrieve a fully-configured\ncontext from the `start` contract." - ], - "signature": [ - "({ children, ...services }: React.PropsWithChildren<", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxServices", - "text": "SharedUxServices" - }, - ">) => JSX.Element" - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServicesProvider.$1", - "type": "CompoundType", - "tags": [], - "label": "{ children, ...services }", - "description": [], - "signature": [ - "React.PropsWithChildren<", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxServices", - "text": "SharedUxServices" - }, - ">" - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServicesFactory", - "type": "Function", - "tags": [], - "label": "stubServicesFactory", - "description": [ - "\nA factory function for creating simple stubbed implementations of all `SharedUxServices`." - ], - "signature": [ - "() => { application: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxApplicationService", - "text": "SharedUxApplicationService" - }, - "; docLinks: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDocLinksService", - "text": "SharedUxDocLinksService" - }, - "; editors: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxEditorsService", - "text": "SharedUxEditorsService" - }, - "; http: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxHttpService", - "text": "SharedUxHttpService" - }, - "; permissions: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxUserPermissionsService", - "text": "SharedUxUserPermissionsService" - }, - "; platform: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxPlatformService", - "text": "SharedUxPlatformService" - }, - "; data: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDataService", - "text": "SharedUxDataService" - }, - "; }" - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.useApplication", - "type": "Function", - "tags": [], - "label": "useApplication", - "description": [], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxApplicationService", - "text": "SharedUxApplicationService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.useData", - "type": "Function", - "tags": [], - "label": "useData", - "description": [ - "\nReact hook for accessing the pre-wired `SharedUxDataService`." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDataService", - "text": "SharedUxDataService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.useDocLinks", - "type": "Function", - "tags": [], - "label": "useDocLinks", - "description": [ - "\nReact hook for accessing the pre-wired `SharedUxDocLinksService`." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDocLinksService", - "text": "SharedUxDocLinksService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.useEditors", - "type": "Function", - "tags": [], - "label": "useEditors", - "description": [ - "\nReact hook for accessing the pre-wired `SharedUxEditorsService`." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxEditorsService", - "text": "SharedUxEditorsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.useHttp", - "type": "Function", - "tags": [], - "label": "useHttp", - "description": [], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxHttpService", - "text": "SharedUxHttpService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.usePermissions", - "type": "Function", - "tags": [], - "label": "usePermissions", - "description": [ - "\nReact hook for accessing the pre-wired `SharedUxPermissionsService`." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxUserPermissionsService", - "text": "SharedUxUserPermissionsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.usePlatformService", - "type": "Function", - "tags": [], - "label": "usePlatformService", - "description": [ - "\nReact hook for accessing the pre-wired `SharedUxPlatformService`." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxPlatformService", - "text": "SharedUxPlatformService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.useSharedUxServices", - "type": "Function", - "tags": [], - "label": "useSharedUxServices", - "description": [ - "\nReact hook for accessing pre-wired `SharedUxServices`." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxServices", - "text": "SharedUxServices" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - } - ], - "interfaces": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.MockServicesFactoryParams", - "type": "Interface", - "tags": [], - "label": "MockServicesFactoryParams", - "description": [], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.MockServicesFactoryParams.config", - "type": "Object", - "tags": [], - "label": "config", - "description": [], - "signature": [ - "MockDataServiceFactoryConfig" - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxApplicationService", - "type": "Interface", - "tags": [], - "label": "SharedUxApplicationService", - "description": [], - "path": "packages/kbn-shared-ux-services/src/services/application.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxApplicationService.navigateToUrl", - "type": "Function", - "tags": [], - "label": "navigateToUrl", - "description": [], - "signature": [ - "(url: string) => void | Promise" - ], - "path": "packages/kbn-shared-ux-services/src/services/application.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxApplicationService.navigateToUrl.$1", - "type": "string", - "tags": [], - "label": "url", - "description": [], - "signature": [ - "string" - ], - "path": "packages/kbn-shared-ux-services/src/services/application.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxApplicationService.currentAppId$", - "type": "Object", - "tags": [], - "label": "currentAppId$", - "description": [], - "signature": [ - "Observable", - "" - ], - "path": "packages/kbn-shared-ux-services/src/services/application.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxDataService", - "type": "Interface", - "tags": [], - "label": "SharedUxDataService", - "description": [ - "\nA service providing data information. Typically used for handling of empty state.." - ], - "path": "packages/kbn-shared-ux-services/src/services/data.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxDataService.hasESData", - "type": "Function", - "tags": [], - "label": "hasESData", - "description": [ - "True if the cluster contains data, false otherwise." - ], - "signature": [ - "() => Promise" - ], - "path": "packages/kbn-shared-ux-services/src/services/data.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxDataService.hasUserDataView", - "type": "Function", - "tags": [], - "label": "hasUserDataView", - "description": [ - "True if Kibana instance contains user-created data view, false otherwise." - ], - "signature": [ - "() => Promise" - ], - "path": "packages/kbn-shared-ux-services/src/services/data.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxDataService.hasDataView", - "type": "Function", - "tags": [], - "label": "hasDataView", - "description": [ - "True if Kibana instance contains any data view, including system-created ones." - ], - "signature": [ - "() => Promise" - ], - "path": "packages/kbn-shared-ux-services/src/services/data.ts", - "deprecated": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxDocLinksService", - "type": "Interface", - "tags": [], - "label": "SharedUxDocLinksService", - "description": [ - "\nA service providing links to documentation about various features in Kibana." - ], - "path": "packages/kbn-shared-ux-services/src/services/doc_links.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxDocLinksService.dataViewsDocLink", - "type": "string", - "tags": [], - "label": "dataViewsDocLink", - "description": [ - "A link to information about Data Views in Kibana" - ], - "path": "packages/kbn-shared-ux-services/src/services/doc_links.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxEditorsService", - "type": "Interface", - "tags": [], - "label": "SharedUxEditorsService", - "description": [ - "\nA service providing methods to invoke and interact with various editors provided\nin Kibana." - ], - "path": "packages/kbn-shared-ux-services/src/services/editors.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxEditorsService.openDataViewEditor", - "type": "Function", - "tags": [], - "label": "openDataViewEditor", - "description": [ - "A method to open the Data View Editor flow." - ], - "signature": [ - "(options: DataViewEditorOptions) => () => void" - ], - "path": "packages/kbn-shared-ux-services/src/services/editors.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxEditorsService.openDataViewEditor.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - "DataViewEditorOptions" - ], - "path": "packages/kbn-shared-ux-services/src/services/editors.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxHttpService", - "type": "Interface", - "tags": [], - "label": "SharedUxHttpService", - "description": [], - "path": "packages/kbn-shared-ux-services/src/services/http.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxHttpService.addBasePath", - "type": "Function", - "tags": [], - "label": "addBasePath", - "description": [], - "signature": [ - "(url: string) => string" - ], - "path": "packages/kbn-shared-ux-services/src/services/http.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxHttpService.addBasePath.$1", - "type": "string", - "tags": [], - "label": "url", - "description": [], - "signature": [ - "string" - ], - "path": "packages/kbn-shared-ux-services/src/services/http.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxPlatformService", - "type": "Interface", - "tags": [], - "label": "SharedUxPlatformService", - "description": [ - "\nA service providing methods to interact with the platform in which this code is\nrunning, (almost always Kibana).\n\nRather than provide the entire `CoreStart` contract to components, we provide simplified\nabstractions around a use case specific to Shared UX. This way, we know exactly how the\n`CoreStart` and other plugins are used. This makes mocking and refactoring easier when\n upstream dependencies change." - ], - "path": "packages/kbn-shared-ux-services/src/services/platform.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxPlatformService.setIsFullscreen", - "type": "Function", - "tags": [], - "label": "setIsFullscreen", - "description": [ - "\nSets the fullscreen state of the chrome." - ], - "signature": [ - "(isFullscreen: boolean) => void" - ], - "path": "packages/kbn-shared-ux-services/src/services/platform.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxPlatformService.setIsFullscreen.$1", - "type": "boolean", - "tags": [], - "label": "isFullscreen", - "description": [ - "True if the chrome should be fullscreen, false otherwise." - ], - "signature": [ - "boolean" - ], - "path": "packages/kbn-shared-ux-services/src/services/platform.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices", - "type": "Interface", - "tags": [], - "label": "SharedUxServices", - "description": [ - "\nA collection of services utilized by SharedUX. This serves as a thin\nabstraction layer between services provided by Kibana and other plugins\nwhile allowing this plugin to be developed independently of those contracts.\n\nIt also allows us to \"swap out\" differenct implementations of these services\nfor different environments, (e.g. Jest, Storybook, etc.)" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.application", - "type": "Object", - "tags": [], - "label": "application", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxApplicationService", - "text": "SharedUxApplicationService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.docLinks", - "type": "Object", - "tags": [], - "label": "docLinks", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDocLinksService", - "text": "SharedUxDocLinksService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.editors", - "type": "Object", - "tags": [], - "label": "editors", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxEditorsService", - "text": "SharedUxEditorsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.http", - "type": "Object", - "tags": [], - "label": "http", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxHttpService", - "text": "SharedUxHttpService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.permissions", - "type": "Object", - "tags": [], - "label": "permissions", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxUserPermissionsService", - "text": "SharedUxUserPermissionsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.platform", - "type": "Object", - "tags": [], - "label": "platform", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxPlatformService", - "text": "SharedUxPlatformService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.data", - "type": "Object", - "tags": [], - "label": "data", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDataService", - "text": "SharedUxDataService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxUserPermissionsService", - "type": "Interface", - "tags": [], - "label": "SharedUxUserPermissionsService", - "description": [ - "\nA service providing permissions information, typically for the current user." - ], - "path": "packages/kbn-shared-ux-services/src/services/permissions.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxUserPermissionsService.canCreateNewDataView", - "type": "boolean", - "tags": [], - "label": "canCreateNewDataView", - "description": [ - "True if the user has permission to create a new Data View, false otherwise." - ], - "path": "packages/kbn-shared-ux-services/src/services/permissions.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxUserPermissionsService.canAccessFleet", - "type": "boolean", - "tags": [], - "label": "canAccessFleet", - "description": [], - "path": "packages/kbn-shared-ux-services/src/services/permissions.ts", - "deprecated": false - } - ], - "initialIsOpen": false - } - ], - "enums": [], - "misc": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.ServiceFactory", - "type": "Type", - "tags": [], - "label": "ServiceFactory", - "description": [ - "\nA factory function for creating one or more services.\n\nThe `S` generic determines the shape of the API being produced.\nThe `Parameters` generic determines what parameters are expected to\ncreate the service." - ], - "signature": [ - "(params: Parameters) => S" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.ServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServicesContext", - "type": "Type", - "tags": [], - "label": "SharedUxServicesContext", - "description": [ - "\nA type representing a component that provides the `SharedUxServices` through a\nReact Context." - ], - "signature": [ - "React.FunctionComponent<{}>" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServicesContext.$1", - "type": "CompoundType", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "P & { children?: React.ReactNode; }" - ], - "path": "node_modules/@types/react/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServicesContext.$2", - "type": "Any", - "tags": [], - "label": "context", - "description": [], - "signature": [ - "any" - ], - "path": "node_modules/@types/react/index.d.ts", - "deprecated": false - } - ], - "initialIsOpen": false - } - ], - "objects": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories", - "type": "Object", - "tags": [], - "label": "mockServiceFactories", - "description": [ - "\nA collection of mock Service Factories." - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.applicationServiceFactory", - "type": "Function", - "tags": [], - "label": "applicationServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxApplicationService", - "text": "SharedUxApplicationService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.applicationServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.docLinksServiceFactory", - "type": "Function", - "tags": [], - "label": "docLinksServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDocLinksService", - "text": "SharedUxDocLinksService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.docLinksServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.editorsServiceFactory", - "type": "Function", - "tags": [], - "label": "editorsServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxEditorsService", - "text": "SharedUxEditorsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.editorsServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.httpServiceFactory", - "type": "Function", - "tags": [], - "label": "httpServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxHttpService", - "text": "SharedUxHttpService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.httpServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.platformServiceFactory", - "type": "Function", - "tags": [], - "label": "platformServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxPlatformService", - "text": "SharedUxPlatformService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.platformServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.userPermissionsServiceFactory", - "type": "Function", - "tags": [], - "label": "userPermissionsServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxUserPermissionsService", - "text": "SharedUxUserPermissionsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.userPermissionsServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.dataServiceFactory", - "type": "Function", - "tags": [], - "label": "dataServiceFactory", - "description": [], - "signature": [ - "(config?: ", - "MockDataServiceFactoryConfig", - " | undefined) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDataService", - "text": "SharedUxDataService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.dataServiceFactory.$1", - "type": "Object", - "tags": [], - "label": "config", - "description": [], - "signature": [ - "MockDataServiceFactoryConfig", - " | undefined" - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/data.mock.ts", - "deprecated": false - } - ] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories", - "type": "Object", - "tags": [], - "label": "stubServiceFactories", - "description": [ - "\nA collection of stubbed service factories." - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.applicationServiceFactory", - "type": "Function", - "tags": [], - "label": "applicationServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxApplicationService", - "text": "SharedUxApplicationService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.applicationServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.docLinksServiceFactory", - "type": "Function", - "tags": [], - "label": "docLinksServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDocLinksService", - "text": "SharedUxDocLinksService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.docLinksServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.editorsServiceFactory", - "type": "Function", - "tags": [], - "label": "editorsServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxEditorsService", - "text": "SharedUxEditorsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.editorsServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.httpServiceFactory", - "type": "Function", - "tags": [], - "label": "httpServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxHttpService", - "text": "SharedUxHttpService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.httpServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.platformServiceFactory", - "type": "Function", - "tags": [], - "label": "platformServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxPlatformService", - "text": "SharedUxPlatformService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.platformServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.userPermissionsServiceFactory", - "type": "Function", - "tags": [], - "label": "userPermissionsServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxUserPermissionsService", - "text": "SharedUxUserPermissionsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.userPermissionsServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.dataServiceFactory", - "type": "Function", - "tags": [], - "label": "dataServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDataService", - "text": "SharedUxDataService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.dataServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - } - ], - "initialIsOpen": false - } - ] - } -} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_services.mdx b/api_docs/kbn_shared_ux_services.mdx deleted file mode 100644 index 3cd0a9b558337..0000000000000 --- a/api_docs/kbn_shared_ux_services.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -#### -#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. -#### Reach out in #docs-engineering for more info. -#### -id: kibKbnSharedUxServicesPluginApi -slug: /kibana-dev-docs/api/kbn-shared-ux-services -title: "@kbn/shared-ux-services" -image: https://source.unsplash.com/400x175/?github -description: API docs for the @kbn/shared-ux-services plugin -date: 2022-08-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-services'] ---- -import kbnSharedUxServicesObj from './kbn_shared_ux_services.devdocs.json'; - - - -Contact [Owner missing] for questions regarding this plugin. - -**Code health stats** - -| Public API count | Any count | Items lacking comments | Missing exports | -|-------------------|-----------|------------------------|-----------------| -| 80 | 0 | 51 | 1 | - -## Common - -### Objects - - -### Functions - - -### Interfaces - - -### Consts, variables and types - - diff --git a/api_docs/kbn_shared_ux_storybook.devdocs.json b/api_docs/kbn_shared_ux_storybook.devdocs.json deleted file mode 100644 index 82e09aac247b9..0000000000000 --- a/api_docs/kbn_shared_ux_storybook.devdocs.json +++ /dev/null @@ -1,324 +0,0 @@ -{ - "id": "@kbn/shared-ux-storybook", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [ - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.applicationServiceFactory", - "type": "Function", - "tags": [], - "label": "applicationServiceFactory", - "description": [ - "\nA factory function for creating for creating a storybook implementation of `SharedUXApplicationService`." - ], - "signature": [ - "() => { navigateToUrl: (url: string) => Promise; currentAppId$: ", - "BehaviorSubject", - "; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/application.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.dataServiceFactory", - "type": "Function", - "tags": [], - "label": "dataServiceFactory", - "description": [ - "\nA factory function for creating a Storybook implementation of `SharedUxDataService`." - ], - "signature": [ - "(params: ", - { - "pluginId": "@kbn/shared-ux-storybook", - "scope": "common", - "docId": "kibKbnSharedUxStorybookPluginApi", - "section": "def-common.DataServiceFactoryConfig", - "text": "DataServiceFactoryConfig" - }, - ") => { hasESData: () => Promise; hasDataView: () => Promise; hasUserDataView: () => Promise; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/data.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.dataServiceFactory.$1", - "type": "Object", - "tags": [], - "label": "params", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-storybook", - "scope": "common", - "docId": "kibKbnSharedUxStorybookPluginApi", - "section": "def-common.DataServiceFactoryConfig", - "text": "DataServiceFactoryConfig" - } - ], - "path": "packages/kbn-shared-ux-storybook/src/services/data.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.docLinksServiceFactory", - "type": "Function", - "tags": [], - "label": "docLinksServiceFactory", - "description": [ - "\nA factory function for creating a Storybook implementation of `SharedUxDocLinksService`." - ], - "signature": [ - "() => { dataViewsDocLink: string; kibanaGuideDocLink: string; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/doc_links.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.editorsServiceFactory", - "type": "Function", - "tags": [], - "label": "editorsServiceFactory", - "description": [ - "\nA factory function for creating a Storybook implementation of `SharedUxEditorsService`." - ], - "signature": [ - "() => { openDataViewEditor: (options: ", - "DataViewEditorOptions", - ") => () => void; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/editors.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.httpServiceFactory", - "type": "Function", - "tags": [], - "label": "httpServiceFactory", - "description": [ - "\nA factory function for creating a Storybook-based implementation of `SharedUXHttpService`." - ], - "signature": [ - "() => { addBasePath: (url: string) => string; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/http.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.platformServiceFactory", - "type": "Function", - "tags": [], - "label": "platformServiceFactory", - "description": [ - "\nA factory function for creating a Storybook implementation of `SharedUxPlatformService`." - ], - "signature": [ - "() => { setIsFullscreen: ", - "HandlerFunction", - "; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/platform.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.servicesDecorator", - "type": "Function", - "tags": [], - "label": "servicesDecorator", - "description": [ - "\nA Storybook decorator that provides the Shared UX `ServicesProvider` with Storybook-specific\nimplementations to stories." - ], - "signature": [ - "(storyFn: ", - "PartialStoryFn", - ", ", - "Args", - ">) => JSX.Element" - ], - "path": "packages/kbn-shared-ux-storybook/src/decorators.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.servicesDecorator.$1", - "type": "Function", - "tags": [], - "label": "storyFn", - "description": [], - "signature": [ - "PartialStoryFn", - ", ", - "Args", - ">" - ], - "path": "packages/kbn-shared-ux-storybook/src/decorators.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.servicesFactory", - "type": "Function", - "tags": [], - "label": "servicesFactory", - "description": [ - "\nA factory function for creating a Storybook implementation of `SharedUxServices`." - ], - "signature": [ - "(params: {}) => { application: ", - "SharedUxApplicationService", - "; docLinks: ", - "SharedUxDocLinksService", - "; editors: ", - "SharedUxEditorsService", - "; http: ", - "SharedUxHttpService", - "; permissions: ", - "SharedUxUserPermissionsService", - "; platform: ", - "SharedUxPlatformService", - "; data: ", - "SharedUxDataService", - "; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.servicesFactory.$1", - "type": "Object", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "{}" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/index.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.userPermissionsServiceFactory", - "type": "Function", - "tags": [], - "label": "userPermissionsServiceFactory", - "description": [ - "\nA factory function for creating a Storybook implementation of `SharedUxUserPermissionsService`." - ], - "signature": [ - "() => { canCreateNewDataView: true; canAccessFleet: true; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/permissions.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - } - ], - "interfaces": [ - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.DataServiceFactoryConfig", - "type": "Interface", - "tags": [], - "label": "DataServiceFactoryConfig", - "description": [], - "path": "packages/kbn-shared-ux-storybook/src/services/data.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.DataServiceFactoryConfig.hasESData", - "type": "boolean", - "tags": [], - "label": "hasESData", - "description": [], - "path": "packages/kbn-shared-ux-storybook/src/services/data.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.DataServiceFactoryConfig.hasDataView", - "type": "boolean", - "tags": [], - "label": "hasDataView", - "description": [], - "path": "packages/kbn-shared-ux-storybook/src/services/data.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.DataServiceFactoryConfig.hasUserDataView", - "type": "boolean", - "tags": [], - "label": "hasUserDataView", - "description": [], - "path": "packages/kbn-shared-ux-storybook/src/services/data.ts", - "deprecated": false - } - ], - "initialIsOpen": false - } - ], - "enums": [], - "misc": [], - "objects": [] - } -} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_storybook_mock.devdocs.json b/api_docs/kbn_shared_ux_storybook_mock.devdocs.json index 63551c7aca499..2db55d58a00a6 100644 --- a/api_docs/kbn_shared_ux_storybook_mock.devdocs.json +++ b/api_docs/kbn_shared_ux_storybook_mock.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock", + "id": "def-common.AbstractStorybookMock", "type": "Class", "tags": [], "label": "AbstractStorybookMock", @@ -22,9 +30,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-storybook-mock", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxStorybookMockPluginApi", - "section": "def-server.AbstractStorybookMock", + "section": "def-common.AbstractStorybookMock", "text": "AbstractStorybookMock" }, "" @@ -34,7 +42,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.propArguments", + "id": "def-common.AbstractStorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -51,7 +59,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.serviceArguments", + "id": "def-common.AbstractStorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -68,7 +76,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.dependencies", + "id": "def-common.AbstractStorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -78,9 +86,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-storybook-mock", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxStorybookMockPluginApi", - "section": "def-server.AbstractStorybookMock", + "section": "def-common.AbstractStorybookMock", "text": "AbstractStorybookMock" }, "<", @@ -92,7 +100,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getPropArgumentTypes", + "id": "def-common.AbstractStorybookMock.getPropArgumentTypes", "type": "Function", "tags": [], "label": "getPropArgumentTypes", @@ -111,7 +119,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getServiceArgumentTypes", + "id": "def-common.AbstractStorybookMock.getServiceArgumentTypes", "type": "Function", "tags": [], "label": "getServiceArgumentTypes", @@ -134,7 +142,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getArgumentTypes", + "id": "def-common.AbstractStorybookMock.getArgumentTypes", "type": "Function", "tags": [], "label": "getArgumentTypes", @@ -159,7 +167,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getArgumentValue", + "id": "def-common.AbstractStorybookMock.getArgumentValue", "type": "Function", "tags": [], "label": "getArgumentValue", @@ -176,7 +184,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getArgumentValue.$1", + "id": "def-common.AbstractStorybookMock.getArgumentValue.$1", "type": "CompoundType", "tags": [], "label": "arg", @@ -190,7 +198,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getArgumentValue.$2", + "id": "def-common.AbstractStorybookMock.getArgumentValue.$2", "type": "Object", "tags": [], "label": "params", @@ -208,7 +216,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getProps", + "id": "def-common.AbstractStorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -225,7 +233,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getProps.$1", + "id": "def-common.AbstractStorybookMock.getProps.$1", "type": "Object", "tags": [], "label": "params", @@ -243,7 +251,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getServices", + "id": "def-common.AbstractStorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -260,7 +268,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getServices.$1", + "id": "def-common.AbstractStorybookMock.getServices.$1", "type": "Object", "tags": [], "label": "params", @@ -285,13 +293,5 @@ "enums": [], "misc": [], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_storybook_mock.mdx b/api_docs/kbn_shared_ux_storybook_mock.mdx index 6056eebf2073c..cb8c5346408ca 100644 --- a/api_docs/kbn_shared_ux_storybook_mock.mdx +++ b/api_docs/kbn_shared_ux_storybook_mock.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-mock title: "@kbn/shared-ux-storybook-mock" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-mock plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-mock'] --- import kbnSharedUxStorybookMockObj from './kbn_shared_ux_storybook_mock.devdocs.json'; @@ -23,8 +23,8 @@ Contact [Owner missing] for questions regarding this plugin. |-------------------|-----------|------------------------|-----------------| | 14 | 0 | 4 | 1 | -## Server +## Common ### Classes - + diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index d4532af9ce1a3..6b98d28e80250 100644 --- a/api_docs/kbn_shared_ux_utility.mdx +++ b/api_docs/kbn_shared_ux_utility.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-utility title: "@kbn/shared-ux-utility" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-utility plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-utility'] --- import kbnSharedUxUtilityObj from './kbn_shared_ux_utility.devdocs.json'; diff --git a/api_docs/kbn_some_dev_log.mdx b/api_docs/kbn_some_dev_log.mdx index e400043829cd2..aa703428e586e 100644 --- a/api_docs/kbn_some_dev_log.mdx +++ b/api_docs/kbn_some_dev_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-some-dev-log title: "@kbn/some-dev-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/some-dev-log plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/some-dev-log'] --- import kbnSomeDevLogObj from './kbn_some_dev_log.devdocs.json'; diff --git a/api_docs/kbn_sort_package_json.mdx b/api_docs/kbn_sort_package_json.mdx index 1f60725fb3082..921e9967e5435 100644 --- a/api_docs/kbn_sort_package_json.mdx +++ b/api_docs/kbn_sort_package_json.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sort-package-json title: "@kbn/sort-package-json" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sort-package-json plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sort-package-json'] --- import kbnSortPackageJsonObj from './kbn_sort_package_json.devdocs.json'; diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index ef2382b4516a6..60cb11db4c8c8 100644 --- a/api_docs/kbn_std.mdx +++ b/api_docs/kbn_std.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-std title: "@kbn/std" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/std plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/std'] --- import kbnStdObj from './kbn_std.devdocs.json'; diff --git a/api_docs/kbn_stdio_dev_helpers.mdx b/api_docs/kbn_stdio_dev_helpers.mdx index 2a36a6c565c7f..7a459ef502e73 100644 --- a/api_docs/kbn_stdio_dev_helpers.mdx +++ b/api_docs/kbn_stdio_dev_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-stdio-dev-helpers title: "@kbn/stdio-dev-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/stdio-dev-helpers plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/stdio-dev-helpers'] --- import kbnStdioDevHelpersObj from './kbn_stdio_dev_helpers.devdocs.json'; diff --git a/api_docs/kbn_storybook.mdx b/api_docs/kbn_storybook.mdx index 7e34703fad221..d2d0c0806b170 100644 --- a/api_docs/kbn_storybook.mdx +++ b/api_docs/kbn_storybook.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-storybook title: "@kbn/storybook" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/storybook plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] --- import kbnStorybookObj from './kbn_storybook.devdocs.json'; diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index 2154d4d3bedd1..77dfec7a8f9c4 100644 --- a/api_docs/kbn_telemetry_tools.mdx +++ b/api_docs/kbn_telemetry_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-telemetry-tools title: "@kbn/telemetry-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/telemetry-tools plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] --- import kbnTelemetryToolsObj from './kbn_telemetry_tools.devdocs.json'; diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index 61722dff929f3..62ed00ec41d40 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test title: "@kbn/test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] --- import kbnTestObj from './kbn_test.devdocs.json'; diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 8584bb4f1557c..309b23b1a8322 100644 --- a/api_docs/kbn_test_jest_helpers.mdx +++ b/api_docs/kbn_test_jest_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-jest-helpers title: "@kbn/test-jest-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-jest-helpers plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-jest-helpers'] --- import kbnTestJestHelpersObj from './kbn_test_jest_helpers.devdocs.json'; diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index ad9684def1d23..2620756f3699f 100644 --- a/api_docs/kbn_tooling_log.mdx +++ b/api_docs/kbn_tooling_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-tooling-log title: "@kbn/tooling-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/tooling-log plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] --- import kbnToolingLogObj from './kbn_tooling_log.devdocs.json'; diff --git a/api_docs/kbn_type_summarizer.mdx b/api_docs/kbn_type_summarizer.mdx index 23bc5769e7653..a6e087586ec21 100644 --- a/api_docs/kbn_type_summarizer.mdx +++ b/api_docs/kbn_type_summarizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer title: "@kbn/type-summarizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/type-summarizer plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer'] --- import kbnTypeSummarizerObj from './kbn_type_summarizer.devdocs.json'; diff --git a/api_docs/kbn_type_summarizer_core.mdx b/api_docs/kbn_type_summarizer_core.mdx index b6c84836fcaf0..e0f873f4510ef 100644 --- a/api_docs/kbn_type_summarizer_core.mdx +++ b/api_docs/kbn_type_summarizer_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer-core title: "@kbn/type-summarizer-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/type-summarizer-core plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer-core'] --- import kbnTypeSummarizerCoreObj from './kbn_type_summarizer_core.devdocs.json'; diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index bbd417a8c2338..9ca9e722093a3 100644 --- a/api_docs/kbn_typed_react_router_config.mdx +++ b/api_docs/kbn_typed_react_router_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-typed-react-router-config title: "@kbn/typed-react-router-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/typed-react-router-config plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/typed-react-router-config'] --- import kbnTypedReactRouterConfigObj from './kbn_typed_react_router_config.devdocs.json'; diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index 1f901ee1937e9..bcfb965ffb4fa 100644 --- a/api_docs/kbn_ui_theme.mdx +++ b/api_docs/kbn_ui_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-theme title: "@kbn/ui-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-theme plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] --- import kbnUiThemeObj from './kbn_ui_theme.devdocs.json'; diff --git a/api_docs/kbn_user_profile_components.devdocs.json b/api_docs/kbn_user_profile_components.devdocs.json index ee6fa83b35cdf..5ef1677f7275b 100644 --- a/api_docs/kbn_user_profile_components.devdocs.json +++ b/api_docs/kbn_user_profile_components.devdocs.json @@ -187,7 +187,7 @@ }, " extends Omit<", "EuiAvatarProps", - ", \"type\" | \"color\" | \"name\" | \"iconColor\" | \"iconType\" | \"iconSize\" | \"initials\" | \"initialsLength\" | \"imageUrl\">" + ", \"type\" | \"color\" | \"iconColor\" | \"name\" | \"iconType\" | \"iconSize\" | \"initials\" | \"initialsLength\" | \"imageUrl\">" ], "path": "packages/kbn-user-profile-components/src/user_avatar.tsx", "deprecated": false, diff --git a/api_docs/kbn_user_profile_components.mdx b/api_docs/kbn_user_profile_components.mdx index 8a8711294bfae..5f892773f33c9 100644 --- a/api_docs/kbn_user_profile_components.mdx +++ b/api_docs/kbn_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-user-profile-components title: "@kbn/user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/user-profile-components plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/user-profile-components'] --- import kbnUserProfileComponentsObj from './kbn_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index 3dc70a87df736..b4c2e9d288602 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types title: "@kbn/utility-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types'] --- import kbnUtilityTypesObj from './kbn_utility_types.devdocs.json'; diff --git a/api_docs/kbn_utility_types_jest.mdx b/api_docs/kbn_utility_types_jest.mdx index 4ebd4a92545d4..418ea2dd0cc68 100644 --- a/api_docs/kbn_utility_types_jest.mdx +++ b/api_docs/kbn_utility_types_jest.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types-jest title: "@kbn/utility-types-jest" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types-jest plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types-jest'] --- import kbnUtilityTypesJestObj from './kbn_utility_types_jest.devdocs.json'; diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index 83af01c36104c..ae11cdca1f69e 100644 --- a/api_docs/kbn_utils.mdx +++ b/api_docs/kbn_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utils title: "@kbn/utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index 9dfd6a93e2cb7..db2638b3efe3b 100644 --- a/api_docs/kbn_yarn_lock_validator.mdx +++ b/api_docs/kbn_yarn_lock_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-yarn-lock-validator title: "@kbn/yarn-lock-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/yarn-lock-validator plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.devdocs.json'; diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index 02913124fd53b..6067849d4fcdb 100644 --- a/api_docs/kibana_overview.mdx +++ b/api_docs/kibana_overview.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaOverview title: "kibanaOverview" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaOverview plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] --- import kibanaOverviewObj from './kibana_overview.devdocs.json'; diff --git a/api_docs/kibana_react.devdocs.json b/api_docs/kibana_react.devdocs.json index 220e36cce7cf0..f2c484815e9b2 100644 --- a/api_docs/kibana_react.devdocs.json +++ b/api_docs/kibana_react.devdocs.json @@ -1723,8 +1723,7 @@ "id": "def-public.RedirectAppLinks", "type": "Function", "tags": [ - "deprecated", - "kbn-shared-ux-components" + "deprecated" ], "label": "RedirectAppLinks", "description": [ @@ -1820,30 +1819,6 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/public/components/custom_assets_accordion.tsx" }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx" - }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx" - }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx" - }, { "plugin": "observability", "path": "x-pack/plugins/observability/public/application/index.tsx" @@ -4034,7 +4009,7 @@ "signature": [ "Omit<", "EuiPageProps", - ", \"paddingSize\"> & { template?: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\" | undefined; paddingSize?: \"none\" | \"s\" | \"m\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", + ", \"paddingSize\"> & { template?: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\" | undefined; paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", "EuiPageSideBarProps", " | undefined; pageHeader?: ", "EuiPageHeaderProps", diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index 975446da2b0d3..2227c7fdaaa2c 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaReact title: "kibanaReact" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaReact plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] --- import kibanaReactObj from './kibana_react.devdocs.json'; diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index af578259a0cee..ae889a34552e2 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaUtils title: "kibanaUtils" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaUtils plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaUtils'] --- import kibanaUtilsObj from './kibana_utils.devdocs.json'; diff --git a/api_docs/kubernetes_security.mdx b/api_docs/kubernetes_security.mdx index 3d10c27a68a86..6a175c0a44c3e 100644 --- a/api_docs/kubernetes_security.mdx +++ b/api_docs/kubernetes_security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kubernetesSecurity title: "kubernetesSecurity" image: https://source.unsplash.com/400x175/?github description: API docs for the kubernetesSecurity plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kubernetesSecurity'] --- import kubernetesSecurityObj from './kubernetes_security.devdocs.json'; diff --git a/api_docs/lens.devdocs.json b/api_docs/lens.devdocs.json index edff001999c49..4746d5f7c2957 100644 --- a/api_docs/lens.devdocs.json +++ b/api_docs/lens.devdocs.json @@ -1235,7 +1235,7 @@ "label": "xScaleType", "description": [], "signature": [ - "\"time\" | \"linear\" | \"ordinal\"" + "\"linear\" | \"time\" | \"ordinal\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false @@ -1302,7 +1302,13 @@ "label": "decorations", "description": [], "signature": [ - "DataDecorationConfigResult", + { + "pluginId": "expressionXY", + "scope": "common", + "docId": "kibExpressionXYPluginApi", + "section": "def-common.DataDecorationConfigResult", + "text": "DataDecorationConfigResult" + }, "[] | undefined" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", @@ -3779,7 +3785,7 @@ "\nThe change type indicates what was changed in this table compared to the currently active table of this layer." ], "signature": [ - "\"initial\" | \"layers\" | \"unchanged\" | \"reduced\" | \"extended\" | \"reorder\"" + "\"layers\" | \"initial\" | \"unchanged\" | \"reduced\" | \"extended\" | \"reorder\"" ], "path": "x-pack/plugins/lens/public/types.ts", "deprecated": false @@ -7921,7 +7927,7 @@ "label": "XScaleType", "description": [], "signature": [ - "\"time\" | \"linear\" | \"ordinal\"" + "\"linear\" | \"time\" | \"ordinal\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false, @@ -7999,7 +8005,7 @@ "label": "YScaleType", "description": [], "signature": [ - "\"log\" | \"time\" | \"linear\" | \"sqrt\"" + "\"linear\" | \"log\" | \"time\" | \"sqrt\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false, @@ -9115,7 +9121,7 @@ "label": "OperationTypePost712", "description": [], "signature": [ - "\"range\" | \"min\" | \"max\" | \"sum\" | \"filters\" | \"count\" | \"date_histogram\" | \"percentile\" | \"average\" | \"terms\" | \"median\" | \"cumulative_sum\" | \"moving_average\" | \"unique_count\" | \"last_value\" | \"counter_rate\" | \"differences\"" + "\"range\" | \"min\" | \"max\" | \"filters\" | \"count\" | \"date_histogram\" | \"percentile\" | \"sum\" | \"average\" | \"terms\" | \"median\" | \"cumulative_sum\" | \"moving_average\" | \"unique_count\" | \"last_value\" | \"counter_rate\" | \"differences\"" ], "path": "x-pack/plugins/lens/server/migrations/types.ts", "deprecated": false, @@ -9129,7 +9135,7 @@ "label": "OperationTypePre712", "description": [], "signature": [ - "\"range\" | \"min\" | \"max\" | \"sum\" | \"filters\" | \"count\" | \"date_histogram\" | \"percentile\" | \"terms\" | \"avg\" | \"median\" | \"cumulative_sum\" | \"derivative\" | \"moving_average\" | \"last_value\" | \"counter_rate\" | \"cardinality\"" + "\"range\" | \"min\" | \"max\" | \"filters\" | \"count\" | \"date_histogram\" | \"percentile\" | \"sum\" | \"terms\" | \"avg\" | \"median\" | \"cumulative_sum\" | \"derivative\" | \"moving_average\" | \"last_value\" | \"counter_rate\" | \"cardinality\"" ], "path": "x-pack/plugins/lens/server/migrations/types.ts", "deprecated": false, diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index c1f0f2616129f..ba12db930ef84 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github description: API docs for the lens plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] --- import lensObj from './lens.devdocs.json'; diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 57a0409581bb0..c654aeabae1eb 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseApiGuard title: "licenseApiGuard" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseApiGuard plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseApiGuard'] --- import licenseApiGuardObj from './license_api_guard.devdocs.json'; diff --git a/api_docs/license_management.mdx b/api_docs/license_management.mdx index 8dbc9e39ddc7e..c7154ada6b8c7 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseManagement title: "licenseManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseManagement plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] --- import licenseManagementObj from './license_management.devdocs.json'; diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index bcf5dff7e7b9e..491199d91b8f6 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licensing title: "licensing" image: https://source.unsplash.com/400x175/?github description: API docs for the licensing plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] --- import licensingObj from './licensing.devdocs.json'; diff --git a/api_docs/lists.devdocs.json b/api_docs/lists.devdocs.json index f861be8fb6b2f..5d10e9c1761df 100644 --- a/api_docs/lists.devdocs.json +++ b/api_docs/lists.devdocs.json @@ -311,7 +311,7 @@ "label": "exceptionItems", "description": [], "signature": [ - "({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" + "({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" ], "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", "deprecated": false @@ -324,7 +324,7 @@ "label": "exceptionsToDelete", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; }[]" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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/public/exceptions/components/builder/exception_items_renderer.tsx", "deprecated": false @@ -585,7 +585,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -659,7 +659,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -695,7 +695,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -731,7 +731,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -881,7 +881,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -929,7 +929,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -971,7 +971,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -1041,7 +1041,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -1075,7 +1075,7 @@ "signature": [ "({ listId, filter, perPage, pit, page, searchAfter, sortField, sortOrder, namespaceType, }: ", "FindExceptionListItemOptions", - ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; } & { pit?: string | undefined; }) | null>" + ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; } & { pit?: string | undefined; }) | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1111,7 +1111,7 @@ "signature": [ "({ listId, filter, perPage, pit, page, searchAfter, sortField, sortOrder, namespaceType, }: ", "FindExceptionListsItemOptions", - ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; } & { pit?: string | undefined; }) | null>" + ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; } & { pit?: string | undefined; }) | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1147,7 +1147,7 @@ "signature": [ "({ perPage, pit, page, searchAfter, sortField, sortOrder, valueListId, }: ", "FindValueListExceptionListsItems", - ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; } & { pit?: string | undefined; }) | null>" + ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; } & { pit?: string | undefined; }) | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1219,7 +1219,7 @@ "signature": [ "({ filter, perPage, page, pit, searchAfter, sortField, sortOrder, }: ", "FindEndpointListItemOptions", - ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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; } & { pit?: string | undefined; }) | null>" + ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"shape\" | \"short\" | \"binary\" | \"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; } & { pit?: string | undefined; }) | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1668,7 +1668,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -1704,7 +1704,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -1740,7 +1740,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2232,7 +2232,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2268,7 +2268,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2304,7 +2304,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2374,7 +2374,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2408,7 +2408,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2444,7 +2444,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2478,7 +2478,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2512,7 +2512,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2546,7 +2546,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2582,7 +2582,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2618,7 +2618,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2654,7 +2654,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2690,7 +2690,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\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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, @@ -2757,7 +2757,7 @@ "an array with the exception list item entries" ], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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 @@ -3049,7 +3049,7 @@ "item exception entries logic" ], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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\" | \"text\" | \"geo_point\" | \"geo_shape\" | \"date_nanos\" | \"long\" | \"double\" | \"date_range\" | \"ip_range\" | \"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 @@ -3749,7 +3749,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -3817,7 +3815,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -4829,6 +4827,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index 9e8d7035b5a09..146762491ea46 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lists title: "lists" image: https://source.unsplash.com/400x175/?github description: API docs for the lists plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 4c1a4b8a735e0..a957a28e184a4 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github description: API docs for the management plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] --- import managementObj from './management.devdocs.json'; diff --git a/api_docs/maps.devdocs.json b/api_docs/maps.devdocs.json index 26f459392cbd9..631f2acfb53c8 100644 --- a/api_docs/maps.devdocs.json +++ b/api_docs/maps.devdocs.json @@ -466,18 +466,16 @@ "type": "Function", "tags": [], "label": "getFilters", - "description": [ - "\nTODO: Implement this function once https://github.com/elastic/kibana/issues/91282 is resolved" - ], + "description": [], "signature": [ - "() => Promise" + "() => Promise<", + "Filter", + "[]>" ], "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", "deprecated": false, "children": [], - "returnComment": [ - "[]" - ] + "returnComment": [] }, { "parentPluginId": "maps", @@ -485,18 +483,16 @@ "type": "Function", "tags": [], "label": "getQuery", - "description": [ - "\nTODO: Implement this function once https://github.com/elastic/kibana/issues/91282 is resolved" - ], + "description": [], "signature": [ - "() => Promise" + "() => Promise<", + "Query", + " | undefined>" ], "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", "deprecated": false, "children": [], - "returnComment": [ - "undefined" - ] + "returnComment": [] }, { "parentPluginId": "maps", @@ -1348,6 +1344,23 @@ "path": "x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx", "deprecated": false }, + { + "parentPluginId": "maps", + "id": "def-public.BoundsRequestMeta.embeddableSearchContext", + "type": "Object", + "tags": [], + "label": "embeddableSearchContext", + "description": [], + "signature": [ + "{ query?: ", + "Query", + " | undefined; filters: ", + "Filter", + "[]; } | undefined" + ], + "path": "x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx", + "deprecated": false + }, { "parentPluginId": "maps", "id": "def-public.BoundsRequestMeta.sourceQuery", @@ -3990,7 +4003,7 @@ "AbstractSourceDescriptor", " & { id: string; indexPatternId: string; geoField?: string | undefined; applyGlobalQuery: boolean; applyGlobalTime: boolean; applyForceRefresh: boolean; } & { metrics: ", "AggDescriptor", - "[]; } & { indexPatternTitle?: string | undefined; term: string; whereQuery?: ", + "[]; } & { term: string; whereQuery?: ", "Query", " | undefined; size?: number | undefined; type: ", { diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index 231aabc555029..ebbda1c5ded50 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/maps title: "maps" image: https://source.unsplash.com/400x175/?github description: API docs for the maps plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] --- import mapsObj from './maps.devdocs.json'; @@ -21,7 +21,7 @@ Contact [GIS](https://github.com/orgs/elastic/teams/kibana-gis) for questions re | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 255 | 0 | 252 | 25 | +| 256 | 0 | 255 | 25 | ## Client diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index 2728d63f80d53..014add3958be8 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mapsEms title: "mapsEms" image: https://source.unsplash.com/400x175/?github description: API docs for the mapsEms plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/ml.devdocs.json b/api_docs/ml.devdocs.json index 234dc00a385fc..2e5a2b35f7c3a 100644 --- a/api_docs/ml.devdocs.json +++ b/api_docs/ml.devdocs.json @@ -1262,7 +1262,7 @@ }, " extends Pick<", "UseDataGridReturnType", - ", \"status\" | \"baseline\" | \"rowCount\" | \"errorMessage\" | \"chartsVisible\" | \"chartsButtonVisible\" | \"ccsWarning\" | \"columnsWithCharts\" | \"invalidSortingColumnns\" | \"noDataMessage\" | \"onChangeItemsPerPage\" | \"onChangePage\" | \"onSort\" | \"pagination\" | \"setPagination\" | \"setVisibleColumns\" | \"rowCountRelation\" | \"sortingColumns\" | \"tableItems\" | \"toggleChartVisibility\" | \"visibleColumns\" | \"predictionFieldName\" | \"resultsField\">" + ", \"status\" | \"rowCount\" | \"errorMessage\" | \"baseline\" | \"chartsVisible\" | \"chartsButtonVisible\" | \"ccsWarning\" | \"columnsWithCharts\" | \"invalidSortingColumnns\" | \"noDataMessage\" | \"onChangeItemsPerPage\" | \"onChangePage\" | \"onSort\" | \"pagination\" | \"setPagination\" | \"setVisibleColumns\" | \"rowCountRelation\" | \"sortingColumns\" | \"tableItems\" | \"toggleChartVisibility\" | \"visibleColumns\" | \"predictionFieldName\" | \"resultsField\">" ], "path": "x-pack/plugins/ml/public/application/components/data_grid/types.ts", "deprecated": false, diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index a665472312c04..665201c0897bc 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ml title: "ml" image: https://source.unsplash.com/400x175/?github description: API docs for the ml plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] --- import mlObj from './ml.devdocs.json'; diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index 0d33c4876c0f2..ac59a55daf028 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoring title: "monitoring" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoring plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoring'] --- import monitoringObj from './monitoring.devdocs.json'; diff --git a/api_docs/monitoring_collection.mdx b/api_docs/monitoring_collection.mdx index 7784b42a5aa44..2768ea059fdd3 100644 --- a/api_docs/monitoring_collection.mdx +++ b/api_docs/monitoring_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoringCollection title: "monitoringCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoringCollection plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoringCollection'] --- import monitoringCollectionObj from './monitoring_collection.devdocs.json'; diff --git a/api_docs/navigation.devdocs.json b/api_docs/navigation.devdocs.json index 5e8590af0ad15..2e6c408e26aca 100644 --- a/api_docs/navigation.devdocs.json +++ b/api_docs/navigation.devdocs.json @@ -411,13 +411,13 @@ "DisambiguateSet", "<(", "DisambiguateSet", - " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">), WithSpanProps> & WithSpanProps & { iconType?: ", "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -427,13 +427,13 @@ "DisambiguateSet", "<(", "DisambiguateSet", - " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">), WithSpanProps> & WithSpanProps & { iconType?: ", "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -445,15 +445,15 @@ "DisambiguateSet", " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">)> & ", "DisambiguateSet", - " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\"> & { iconType?: ", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\"> & { iconType?: ", "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -463,15 +463,15 @@ "DisambiguateSet", " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">)> & ", "DisambiguateSet", - " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\"> & { iconType?: ", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\"> & { iconType?: ", "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -483,15 +483,15 @@ "DisambiguateSet", " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">)> & ", "DisambiguateSet", - " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\"> & { iconType?: ", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\"> & { iconType?: ", "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -503,7 +503,7 @@ "DisambiguateSet", " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">)> & ", "DisambiguateSet", @@ -511,7 +511,7 @@ "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -521,7 +521,7 @@ "DisambiguateSet", " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">)> & ", "DisambiguateSet", @@ -529,7 +529,7 @@ "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", @@ -541,7 +541,7 @@ "DisambiguateSet", " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"href\" | \"onClick\">) | (", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"color\" | \"onClick\" | \"href\">) | (", "DisambiguateSet", " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"color\" | \"onClick\">)> & ", "DisambiguateSet", @@ -549,7 +549,7 @@ "IconType", " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", "ToolTipPositions", - " | undefined; title?: string | undefined; color?: \"accent\" | \"subdued\" | \"hollow\" | undefined; size?: ", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", "BetaBadgeSize", " | undefined; } & ", "DisambiguateSet", diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index 9304a868f2771..a43eeb0bba57a 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/navigation title: "navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the navigation plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'navigation'] --- import navigationObj from './navigation.devdocs.json'; diff --git a/api_docs/newsfeed.mdx b/api_docs/newsfeed.mdx index 68ca73d1b8955..b208b229abb87 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/newsfeed title: "newsfeed" image: https://source.unsplash.com/400x175/?github description: API docs for the newsfeed plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] --- import newsfeedObj from './newsfeed.devdocs.json'; diff --git a/api_docs/observability.devdocs.json b/api_docs/observability.devdocs.json index 3de0f18c8e087..048601d55003f 100644 --- a/api_docs/observability.devdocs.json +++ b/api_docs/observability.devdocs.json @@ -696,11 +696,11 @@ }, " | undefined; list: () => string[]; }; selectedAlertId?: string | undefined; } & ", "CommonProps", - " & { as?: \"div\" | undefined; } & _EuiFlyoutProps & Omit, HTMLDivElement>, keyof _EuiFlyoutProps> & Omit, HTMLDivElement>, \"key\" | \"css\" | keyof React.HTMLAttributes> & { ref?: React.RefObject | ((instance: HTMLDivElement | null) => void) | null | undefined; }, \"children\" | \"onError\" | \"color\" | \"id\" | \"lang\" | \"tabIndex\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChange\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClick\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | keyof ", + " & { as?: \"div\" | undefined; } & _EuiFlyoutProps & Omit, HTMLDivElement>, keyof _EuiFlyoutProps> & Omit, HTMLDivElement>, \"key\" | \"css\" | keyof React.HTMLAttributes> & { ref?: React.RefObject | ((instance: HTMLDivElement | null) => void) | null | undefined; }, \"children\" | \"onError\" | \"hidden\" | \"color\" | \"title\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"id\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"as\" | keyof ", "CommonProps", - " | \"title\" | \"hidden\" | \"security\" | \"defaultValue\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"as\" | keyof React.ClassAttributes | keyof _EuiFlyoutProps>, \"children\" | \"onError\" | \"color\" | \"id\" | \"lang\" | \"tabIndex\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChange\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClick\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | keyof ", + " | keyof React.ClassAttributes | keyof _EuiFlyoutProps>, \"children\" | \"onError\" | \"hidden\" | \"color\" | \"alert\" | \"title\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"id\" | \"key\" | \"css\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"as\" | keyof ", "CommonProps", - " | \"title\" | \"alert\" | \"hidden\" | \"key\" | \"css\" | \"security\" | \"defaultValue\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"as\" | \"alerts\" | keyof _EuiFlyoutProps | \"isInApp\" | \"observabilityRuleTypeRegistry\" | \"selectedAlertId\"> & { ref?: React.RefObject | ((instance: HTMLDivElement | null) => void) | null | undefined; }> & { readonly _result: ({ alert, alerts, isInApp, observabilityRuleTypeRegistry, onClose, selectedAlertId, }: AlertsFlyoutProps) => JSX.Element | null; }" + " | \"alerts\" | keyof _EuiFlyoutProps | \"isInApp\" | \"observabilityRuleTypeRegistry\" | \"selectedAlertId\"> & { ref?: React.RefObject | ((instance: HTMLDivElement | null) => void) | null | undefined; }> & { readonly _result: ({ alert, alerts, isInApp, observabilityRuleTypeRegistry, onClose, selectedAlertId, }: AlertsFlyoutProps) => JSX.Element | null; }" ], "path": "x-pack/plugins/observability/public/index.ts", "deprecated": false, @@ -3375,25 +3375,6 @@ "path": "x-pack/plugins/observability/public/plugin.ts", "deprecated": false }, - { - "parentPluginId": "observability", - "id": "def-public.ObservabilityPublicPluginsStart.sharedUX", - "type": "Object", - "tags": [], - "label": "sharedUX", - "description": [], - "signature": [ - { - "pluginId": "sharedUX", - "scope": "public", - "docId": "kibSharedUXPluginApi", - "section": "def-public.SharedUXPluginStart", - "text": "SharedUXPluginStart" - } - ], - "path": "x-pack/plugins/observability/public/plugin.ts", - "deprecated": false - }, { "parentPluginId": "observability", "id": "def-public.ObservabilityPublicPluginsStart.ruleTypeRegistry", @@ -4733,20 +4714,6 @@ "deprecated": false, "initialIsOpen": false }, - { - "parentPluginId": "observability", - "id": "def-public.enableInfrastructureView", - "type": "string", - "tags": [], - "label": "enableInfrastructureView", - "description": [], - "signature": [ - "\"observability:enableInfrastructureView\"" - ], - "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", - "deprecated": false, - "initialIsOpen": false - }, { "parentPluginId": "observability", "id": "def-public.enableInspectEsQueries", @@ -5107,11 +5074,11 @@ "DisambiguateSet", ", Omit, \"href\">> & Omit, \"href\">) | (", "DisambiguateSet", - ", \"href\">, React.ButtonHTMLAttributes> & React.ButtonHTMLAttributes))), \"color\" | \"target\" | \"onClick\" | \"rel\"> & { size?: ItemSize | undefined; color?: Color | undefined; label: React.ReactNode; isActive?: boolean | undefined; isDisabled?: boolean | undefined; href?: string | undefined; target?: string | undefined; rel?: string | undefined; iconType?: ", + ", \"href\">, React.ButtonHTMLAttributes> & React.ButtonHTMLAttributes))), \"color\" | \"onClick\" | \"rel\" | \"target\"> & { size?: ItemSize | undefined; color?: Color | undefined; label: React.ReactNode; isActive?: boolean | undefined; isDisabled?: boolean | undefined; href?: string | undefined; target?: string | undefined; rel?: string | undefined; iconType?: ", "IconType", " | undefined; iconProps?: Omit<", "EuiIconProps", - ", \"type\"> | undefined; icon?: React.ReactElement> | undefined; showToolTip?: boolean | undefined; extraAction?: ({ type?: \"button\" | \"reset\" | \"submit\" | undefined; } & ", + ", \"type\"> | undefined; icon?: React.ReactElement> | undefined; showToolTip?: boolean | undefined; extraAction?: ({ type?: \"reset\" | \"button\" | \"submit\" | undefined; } & ", "EuiButtonIconProps", " & { onClick?: React.MouseEventHandler | undefined; } & React.ButtonHTMLAttributes & { buttonRef?: React.Ref | undefined; } & { alwaysShow?: boolean | undefined; }) | undefined; onClick?: React.MouseEventHandler | undefined; wrapText?: boolean | undefined; buttonRef?: React.Ref | undefined; }" ], @@ -5547,7 +5514,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -5615,7 +5580,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -6627,6 +6592,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -7799,20 +7766,6 @@ "deprecated": false, "initialIsOpen": false }, - { - "parentPluginId": "observability", - "id": "def-common.enableInfrastructureView", - "type": "string", - "tags": [], - "label": "enableInfrastructureView", - "description": [], - "signature": [ - "\"observability:enableInfrastructureView\"" - ], - "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", - "deprecated": false, - "initialIsOpen": false - }, { "parentPluginId": "observability", "id": "def-common.enableInspectEsQueries", @@ -7905,7 +7858,7 @@ "label": "TimeUnitChar", "description": [], "signature": [ - "\"d\" | \"s\" | \"m\" | \"h\"" + "\"d\" | \"h\" | \"m\" | \"s\"" ], "path": "x-pack/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 2ea5ad6c3dbbb..1ef626b8f7fc2 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observability title: "observability" image: https://source.unsplash.com/400x175/?github description: API docs for the observability plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Observability UI](https://github.com/orgs/elastic/teams/observability-u | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 399 | 2 | 396 | 30 | +| 396 | 2 | 393 | 30 | ## Client diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index e4fac78f4b40c..0fc1e5d78f97c 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/osquery title: "osquery" image: https://source.unsplash.com/400x175/?github description: API docs for the osquery plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] --- import osqueryObj from './osquery.devdocs.json'; diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index 9b0ffad96ffd8..9dd9cc8c8d2e5 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -7,7 +7,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory description: Directory of public APIs available through plugins or packages. -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -15,13 +15,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 403 | 337 | 37 | +| 410 | 340 | 36 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 29218 | 175 | 19671 | 911 | +| 29330 | 180 | 19815 | 917 | ## Plugin Directory @@ -36,7 +36,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Considering using bfetch capabilities when fetching large amounts of data. This services supports batching HTTP requests and streaming responses back. | 80 | 1 | 71 | 2 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Canvas application to Kibana | 9 | 0 | 8 | 3 | | | [ResponseOps](https://github.com/orgs/elastic/teams/response-ops) | The Case management system in Kibana | 82 | 0 | 66 | 29 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 272 | 2 | 253 | 9 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 261 | 2 | 246 | 9 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 29 | 0 | 24 | 0 | | | [Cloud Security Posture](https://github.com/orgs/elastic/teams/cloud-posture-security) | The cloud security posture plugin | 18 | 0 | 2 | 3 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 13 | 0 | 13 | 1 | @@ -55,16 +55,16 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 10 | 0 | 8 | 2 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 90 | 0 | 73 | 5 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 37 | 0 | 35 | 2 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 512 | 0 | 413 | 4 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 514 | 0 | 414 | 4 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends embeddable plugin with more functionality | 14 | 0 | 14 | 0 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides encryption and decryption utilities for saved objects containing sensitive information. | 51 | 0 | 42 | 0 | -| | [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-search-frontend) | Adds dashboards for discovering and managing Enterprise Search products. | 6 | 0 | 6 | 0 | +| | [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-search-frontend) | Adds dashboards for discovering and managing Enterprise Search products. | 8 | 0 | 8 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 114 | 3 | 110 | 3 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | The Event Annotation service contains expressions for event annotations | 95 | 0 | 95 | 6 | | | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 100 | 0 | 100 | 9 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'error' renderer to expressions | 17 | 0 | 15 | 2 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Gauge plugin adds a `gauge` renderer and function to the expression plugin. The renderer will display the `gauge` chart. | 61 | 0 | 61 | 2 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Heatmap plugin adds a `heatmap` renderer and function to the expression plugin. The renderer will display the `heatmap` chart. | 107 | 0 | 103 | 3 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Gauge plugin adds a `gauge` renderer and function to the expression plugin. The renderer will display the `gauge` chart. | 57 | 0 | 57 | 2 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Heatmap plugin adds a `heatmap` renderer and function to the expression plugin. The renderer will display the `heatmap` chart. | 105 | 0 | 101 | 3 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'image' function and renderer to expressions | 26 | 0 | 26 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Adds a `metric` renderer and function to the expression plugin. The renderer will display the `legacy metric` chart. | 48 | 0 | 48 | 1 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'metric' function and renderer to expressions | 32 | 0 | 27 | 0 | @@ -74,13 +74,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'revealImage' function and renderer to expressions | 14 | 0 | 14 | 3 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'shape' function and renderer to expressions | 148 | 0 | 146 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Tagcloud plugin adds a `tagcloud` renderer and function to the expression plugin. The renderer will display the `Wordcloud` chart. | 7 | 0 | 7 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the `xy` chart. | 151 | 0 | 141 | 12 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the `xy` chart. | 152 | 0 | 142 | 11 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds expression runtime to Kibana | 2183 | 17 | 1729 | 5 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 222 | 0 | 95 | 2 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Index pattern fields and ambiguous values formatters | 288 | 5 | 249 | 3 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The file upload plugin contains components and services for uploading a file, analyzing its data, and then importing the data into an Elasticsearch index. Supported file types include CSV, TSV, newline-delimited JSON and GeoJSON. | 62 | 0 | 62 | 2 | -| | [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/team:AppServicesUx) | File upload, download, sharing, and serving over HTTP implementation in Kibana. | 222 | 0 | 3 | 2 | -| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 957 | 3 | 862 | 9 | +| | [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/team:AppServicesUx) | File upload, download, sharing, and serving over HTTP implementation in Kibana. | 237 | 0 | 3 | 2 | +| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 961 | 3 | 866 | 9 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 68 | 0 | 14 | 5 | | globalSearchBar | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | globalSearchProviders | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | @@ -106,14 +106,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Security detections response](https://github.com/orgs/elastic/teams/security-detections-response) | - | 202 | 0 | 90 | 49 | | logstash | [Logstash](https://github.com/orgs/elastic/teams/logstash) | - | 0 | 0 | 0 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 41 | 0 | 41 | 6 | -| | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 255 | 0 | 252 | 25 | +| | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 256 | 0 | 255 | 25 | | | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 67 | 0 | 67 | 0 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 244 | 9 | 71 | 30 | | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 11 | 0 | 9 | 1 | | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 34 | 0 | 34 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 17 | 0 | -| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 399 | 2 | 396 | 30 | +| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 396 | 2 | 393 | 30 | | | [Security asset management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 13 | 0 | 13 | 0 | | painlessLab | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 243 | 2 | 187 | 12 | @@ -134,7 +134,6 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 54 | 0 | 53 | 22 | | | [Security Team](https://github.com/orgs/elastic/teams/security-team) | - | 3 | 0 | 3 | 1 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds URL Service and sharing capabilities to Kibana | 114 | 0 | 55 | 10 | -| | [Shared UX](https://github.com/orgs/elastic/teams/shared-ux) | A plugin providing components and services for shared user experiences in Kibana. | 4 | 0 | 0 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 22 | 1 | 22 | 1 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides the Spaces feature, which allows saved objects to be organized into meaningful categories. | 260 | 0 | 64 | 0 | | | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 4 | 0 | 4 | 0 | @@ -169,15 +168,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the TSVB visualization. TSVB has its one editor, works with index patterns and index strings and contains 6 types of charts: timeseries, topN, table. markdown, metric and gauge. | 10 | 1 | 10 | 3 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the vega visualization. Is the elastic version of vega and vega-lite libraries. | 2 | 0 | 2 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the vislib visualizations. These are the classical area/line/bar, pie, gauge/goal and heatmap charts. We want to replace them with elastic-charts. | 26 | 0 | 25 | 1 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the new xy-axis chart using the elastic-charts library, which will eventually replace the vislib xy-axis charts including bar, area, and line. | 57 | 0 | 51 | 5 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 380 | 12 | 356 | 14 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the new xy-axis chart using the elastic-charts library, which will eventually replace the vislib xy-axis charts including bar, area, and line. | 53 | 0 | 50 | 5 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 414 | 12 | 386 | 15 | | watcher | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | ## Package Directory | Package name           | Maintaining team | Description | API Cnt | Any Cnt | Missing
comments | Missing
exports | |--------------|----------------|-----------|--------------|----------|---------------|--------| -| | [Owner missing] | Elastic APM trace data generator | 74 | 0 | 74 | 11 | | | [Owner missing] | - | 11 | 5 | 11 | 0 | | | Machine Learning UI | React components for AIOps related efforts. | 6 | 0 | 6 | 0 | | | Machine Learning UI | Static utilities for AIOps related efforts. | 49 | 0 | 24 | 0 | @@ -189,9 +187,11 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 18 | 0 | 0 | 0 | | | Kibana Core | - | 20 | 0 | 0 | 0 | | | [Owner missing] | - | 16 | 0 | 16 | 0 | +| | [Owner missing] | Elastic APM trace data generator | 74 | 0 | 74 | 11 | | | [Owner missing] | - | 11 | 0 | 11 | 0 | | | [Owner missing] | - | 10 | 0 | 10 | 0 | | | [Owner missing] | - | 18 | 0 | 9 | 1 | +| | [Owner missing] | - | 76 | 0 | 76 | 0 | | | [Owner missing] | - | 7 | 0 | 2 | 0 | | | [Owner missing] | - | 3 | 0 | 3 | 0 | | | [Owner missing] | - | 62 | 0 | 17 | 1 | @@ -357,17 +357,20 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Owner missing] | - | 20 | 0 | 6 | 0 | | | [Owner missing] | - | 10 | 0 | 4 | 0 | | | [Owner missing] | - | 32 | 0 | 28 | 0 | -| | [Owner missing] | - | 11 | 0 | 6 | 0 | -| | [Owner missing] | - | 8 | 0 | 7 | 0 | +| | [Owner missing] | - | 10 | 0 | 9 | 0 | | | [Owner missing] | - | 13 | 0 | 4 | 1 | | | [Owner missing] | - | 12 | 0 | 12 | 0 | -| | [Owner missing] | - | 26 | 0 | 3 | 0 | +| | [Owner missing] | - | 8 | 0 | 3 | 0 | | | [Owner missing] | - | 25 | 0 | 24 | 0 | +| | [Owner missing] | - | 10 | 0 | 4 | 0 | +| | [Owner missing] | - | 43 | 5 | 43 | 2 | +| | [Owner missing] | - | 13 | 0 | 4 | 0 | +| | [Owner missing] | - | 11 | 0 | 5 | 0 | +| | [Owner missing] | - | 24 | 0 | 24 | 0 | +| | [Owner missing] | - | 27 | 0 | 26 | 0 | | | [Owner missing] | - | 5 | 0 | 3 | 0 | | | [Owner missing] | - | 24 | 0 | 4 | 0 | | | [Owner missing] | - | 17 | 0 | 16 | 0 | -| | [Owner missing] | - | 80 | 0 | 51 | 1 | -| | [Owner missing] | - | 16 | 0 | 7 | 0 | | | [Owner missing] | - | 14 | 0 | 4 | 1 | | | [Owner missing] | - | 9 | 0 | 3 | 0 | | | [Owner missing] | - | 20 | 0 | 12 | 0 | diff --git a/api_docs/presentation_util.devdocs.json b/api_docs/presentation_util.devdocs.json index 07de3fd699575..c7d62fa7d2661 100644 --- a/api_docs/presentation_util.devdocs.json +++ b/api_docs/presentation_util.devdocs.json @@ -2264,7 +2264,7 @@ "label": "getProjects", "description": [], "signature": [ - "(solutions?: (\"presentation\" | \"dashboard\" | \"canvas\")[] | undefined) => Record<\"labs:dashboard:deferBelowFold\" | \"labs:dashboard:dashboardControls\" | \"labs:canvas:byValueEmbeddable\", ", + "(solutions?: (\"dashboard\" | \"canvas\" | \"presentation\")[] | undefined) => Record<\"labs:dashboard:deferBelowFold\" | \"labs:dashboard:dashboardControls\" | \"labs:canvas:byValueEmbeddable\", ", { "pluginId": "presentationUtil", "scope": "common", @@ -2285,7 +2285,7 @@ "label": "solutions", "description": [], "signature": [ - "(\"presentation\" | \"dashboard\" | \"canvas\")[] | undefined" + "(\"dashboard\" | \"canvas\" | \"presentation\")[] | undefined" ], "path": "src/plugins/presentation_util/public/services/labs.ts", "deprecated": false, @@ -3650,7 +3650,7 @@ "label": "solutions", "description": [], "signature": [ - "(\"presentation\" | \"dashboard\" | \"canvas\")[]" + "(\"dashboard\" | \"canvas\" | \"presentation\")[]" ], "path": "src/plugins/presentation_util/common/labs.ts", "deprecated": false @@ -3861,7 +3861,7 @@ "label": "SolutionName", "description": [], "signature": [ - "\"presentation\" | \"dashboard\" | \"canvas\"" + "\"dashboard\" | \"canvas\" | \"presentation\"" ], "path": "src/plugins/presentation_util/common/labs.ts", "deprecated": false, diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index 6d9e56a7fed21..5c7e49d043365 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/presentationUtil title: "presentationUtil" image: https://source.unsplash.com/400x175/?github description: API docs for the presentationUtil plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] --- import presentationUtilObj from './presentation_util.devdocs.json'; diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index 83e713d6369ad..4e7786a4d04eb 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/remoteClusters title: "remoteClusters" image: https://source.unsplash.com/400x175/?github description: API docs for the remoteClusters plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'remoteClusters'] --- import remoteClustersObj from './remote_clusters.devdocs.json'; diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index da7c1e5338ca7..bdcbe060dfa4f 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/reporting title: "reporting" image: https://source.unsplash.com/400x175/?github description: API docs for the reporting plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'reporting'] --- import reportingObj from './reporting.devdocs.json'; diff --git a/api_docs/rollup.mdx b/api_docs/rollup.mdx index 7ab81c4c95559..b73d9a6198099 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/rollup title: "rollup" image: https://source.unsplash.com/400x175/?github description: API docs for the rollup plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index 245f7b695553c..817429c06f914 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ruleRegistry title: "ruleRegistry" image: https://source.unsplash.com/400x175/?github description: API docs for the ruleRegistry plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] --- import ruleRegistryObj from './rule_registry.devdocs.json'; diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index 028620f9b9131..f6e14a981f176 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/runtimeFields title: "runtimeFields" image: https://source.unsplash.com/400x175/?github description: API docs for the runtimeFields plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] --- import runtimeFieldsObj from './runtime_fields.devdocs.json'; diff --git a/api_docs/saved_objects.devdocs.json b/api_docs/saved_objects.devdocs.json index fba13f71ed1cc..03027ee4ba3a3 100644 --- a/api_docs/saved_objects.devdocs.json +++ b/api_docs/saved_objects.devdocs.json @@ -735,7 +735,7 @@ "section": "def-public.SavedObject", "text": "SavedObject" }, - ", \"id\" | \"title\" | \"getDisplayName\" | \"lastSavedTitle\" | \"copyOnSave\" | \"getEsType\">, isTitleDuplicateConfirmed: boolean, onTitleDuplicate: (() => void) | undefined, services: Pick<", + ", \"title\" | \"id\" | \"getDisplayName\" | \"lastSavedTitle\" | \"copyOnSave\" | \"getEsType\">, isTitleDuplicateConfirmed: boolean, onTitleDuplicate: (() => void) | undefined, services: Pick<", "SavedObjectKibanaServices", ", \"overlays\" | \"savedObjectsClient\">) => Promise" ], @@ -758,7 +758,7 @@ "section": "def-public.SavedObject", "text": "SavedObject" }, - ", \"id\" | \"title\" | \"getDisplayName\" | \"lastSavedTitle\" | \"copyOnSave\" | \"getEsType\">" + ", \"title\" | \"id\" | \"getDisplayName\" | \"lastSavedTitle\" | \"copyOnSave\" | \"getEsType\">" ], "path": "src/plugins/saved_objects/public/saved_object/helpers/check_for_duplicate_title.ts", "deprecated": false, @@ -1449,22 +1449,6 @@ "plugin": "savedObjectsTaggingOss", "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts" - }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts" - }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts" - }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts" - }, { "plugin": "dashboard", "path": "src/plugins/dashboard/public/services/saved_object_loader.ts" @@ -1508,22 +1492,6 @@ { "plugin": "dashboard", "path": "src/plugins/dashboard/public/application/actions/clone_panel_action.tsx" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts" } ], "children": [ diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 9c8355f596624..2cc5e35127c42 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjects title: "savedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjects plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_management.devdocs.json b/api_docs/saved_objects_management.devdocs.json index 9dbe29aa8207f..a0876d761e9a5 100644 --- a/api_docs/saved_objects_management.devdocs.json +++ b/api_docs/saved_objects_management.devdocs.json @@ -278,7 +278,7 @@ "label": "euiColumn", "description": [], "signature": [ - "{ children?: React.ReactNode; onError?: React.ReactEventHandler | undefined; color?: string | undefined; className?: string | undefined; height?: string | number | undefined; id?: string | undefined; lang?: string | undefined; name: React.ReactNode; style?: React.CSSProperties | undefined; width?: string | undefined; role?: React.AriaRole | undefined; tabIndex?: number | undefined; 'aria-activedescendant'?: string | undefined; 'aria-atomic'?: boolean | \"true\" | \"false\" | undefined; 'aria-autocomplete'?: \"none\" | \"list\" | \"inline\" | \"both\" | undefined; 'aria-busy'?: boolean | \"true\" | \"false\" | undefined; 'aria-checked'?: boolean | \"true\" | \"false\" | \"mixed\" | undefined; 'aria-colcount'?: number | undefined; 'aria-colindex'?: number | undefined; 'aria-colspan'?: number | undefined; 'aria-controls'?: string | undefined; 'aria-current'?: boolean | \"date\" | \"location\" | \"true\" | \"false\" | \"page\" | \"step\" | \"time\" | undefined; 'aria-describedby'?: string | undefined; 'aria-details'?: string | undefined; 'aria-disabled'?: boolean | \"true\" | \"false\" | undefined; 'aria-dropeffect'?: \"none\" | \"link\" | \"copy\" | \"execute\" | \"move\" | \"popup\" | undefined; 'aria-errormessage'?: string | undefined; 'aria-expanded'?: boolean | \"true\" | \"false\" | undefined; 'aria-flowto'?: string | undefined; 'aria-grabbed'?: boolean | \"true\" | \"false\" | undefined; 'aria-haspopup'?: boolean | \"dialog\" | \"grid\" | \"listbox\" | \"menu\" | \"tree\" | \"true\" | \"false\" | undefined; 'aria-hidden'?: boolean | \"true\" | \"false\" | undefined; 'aria-invalid'?: boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\" | undefined; 'aria-keyshortcuts'?: string | undefined; 'aria-label'?: string | undefined; 'aria-labelledby'?: string | undefined; 'aria-level'?: number | undefined; 'aria-live'?: \"off\" | \"assertive\" | \"polite\" | undefined; 'aria-modal'?: boolean | \"true\" | \"false\" | undefined; 'aria-multiline'?: boolean | \"true\" | \"false\" | undefined; 'aria-multiselectable'?: boolean | \"true\" | \"false\" | undefined; 'aria-orientation'?: \"horizontal\" | \"vertical\" | undefined; 'aria-owns'?: string | undefined; 'aria-placeholder'?: string | undefined; 'aria-posinset'?: number | undefined; 'aria-pressed'?: boolean | \"true\" | \"false\" | \"mixed\" | undefined; 'aria-readonly'?: boolean | \"true\" | \"false\" | undefined; 'aria-relevant'?: \"all\" | \"text\" | \"additions\" | \"additions removals\" | \"additions text\" | \"removals\" | \"removals additions\" | \"removals text\" | \"text additions\" | \"text removals\" | undefined; 'aria-required'?: boolean | \"true\" | \"false\" | undefined; 'aria-roledescription'?: string | undefined; 'aria-rowcount'?: number | undefined; 'aria-rowindex'?: number | undefined; 'aria-rowspan'?: number | undefined; 'aria-selected'?: boolean | \"true\" | \"false\" | undefined; 'aria-setsize'?: number | undefined; 'aria-sort'?: \"none\" | \"ascending\" | \"descending\" | \"other\" | undefined; 'aria-valuemax'?: number | undefined; 'aria-valuemin'?: number | undefined; 'aria-valuenow'?: number | undefined; 'aria-valuetext'?: string | undefined; dangerouslySetInnerHTML?: { __html: string; } | undefined; onCopy?: React.ClipboardEventHandler | undefined; onCopyCapture?: React.ClipboardEventHandler | undefined; onCut?: React.ClipboardEventHandler | undefined; onCutCapture?: React.ClipboardEventHandler | undefined; onPaste?: React.ClipboardEventHandler | undefined; onPasteCapture?: React.ClipboardEventHandler | undefined; onCompositionEnd?: React.CompositionEventHandler | undefined; onCompositionEndCapture?: React.CompositionEventHandler | undefined; onCompositionStart?: React.CompositionEventHandler | undefined; onCompositionStartCapture?: React.CompositionEventHandler | undefined; onCompositionUpdate?: React.CompositionEventHandler | undefined; onCompositionUpdateCapture?: React.CompositionEventHandler | undefined; onFocus?: React.FocusEventHandler | undefined; onFocusCapture?: React.FocusEventHandler | undefined; onBlur?: React.FocusEventHandler | undefined; onBlurCapture?: React.FocusEventHandler | undefined; onChange?: React.FormEventHandler | undefined; onChangeCapture?: React.FormEventHandler | undefined; onBeforeInput?: React.FormEventHandler | undefined; onBeforeInputCapture?: React.FormEventHandler | undefined; onInput?: React.FormEventHandler | undefined; onInputCapture?: React.FormEventHandler | undefined; onReset?: React.FormEventHandler | undefined; onResetCapture?: React.FormEventHandler | undefined; onSubmit?: React.FormEventHandler | undefined; onSubmitCapture?: React.FormEventHandler | undefined; onInvalid?: React.FormEventHandler | undefined; onInvalidCapture?: React.FormEventHandler | undefined; onLoad?: React.ReactEventHandler | undefined; onLoadCapture?: React.ReactEventHandler | undefined; onErrorCapture?: React.ReactEventHandler | undefined; onKeyDown?: React.KeyboardEventHandler | undefined; onKeyDownCapture?: React.KeyboardEventHandler | undefined; onKeyPress?: React.KeyboardEventHandler | undefined; onKeyPressCapture?: React.KeyboardEventHandler | undefined; onKeyUp?: React.KeyboardEventHandler | undefined; onKeyUpCapture?: React.KeyboardEventHandler | undefined; onAbort?: React.ReactEventHandler | undefined; onAbortCapture?: React.ReactEventHandler | undefined; onCanPlay?: React.ReactEventHandler | undefined; onCanPlayCapture?: React.ReactEventHandler | undefined; onCanPlayThrough?: React.ReactEventHandler | undefined; onCanPlayThroughCapture?: React.ReactEventHandler | undefined; onDurationChange?: React.ReactEventHandler | undefined; onDurationChangeCapture?: React.ReactEventHandler | undefined; onEmptied?: React.ReactEventHandler | undefined; onEmptiedCapture?: React.ReactEventHandler | undefined; onEncrypted?: React.ReactEventHandler | undefined; onEncryptedCapture?: React.ReactEventHandler | undefined; onEnded?: React.ReactEventHandler | undefined; onEndedCapture?: React.ReactEventHandler | undefined; onLoadedData?: React.ReactEventHandler | undefined; onLoadedDataCapture?: React.ReactEventHandler | undefined; onLoadedMetadata?: React.ReactEventHandler | undefined; onLoadedMetadataCapture?: React.ReactEventHandler | undefined; onLoadStart?: React.ReactEventHandler | undefined; onLoadStartCapture?: React.ReactEventHandler | undefined; onPause?: React.ReactEventHandler | undefined; onPauseCapture?: React.ReactEventHandler | undefined; onPlay?: React.ReactEventHandler | undefined; onPlayCapture?: React.ReactEventHandler | undefined; onPlaying?: React.ReactEventHandler | undefined; onPlayingCapture?: React.ReactEventHandler | undefined; onProgress?: React.ReactEventHandler | undefined; onProgressCapture?: React.ReactEventHandler | undefined; onRateChange?: React.ReactEventHandler | undefined; onRateChangeCapture?: React.ReactEventHandler | undefined; onSeeked?: React.ReactEventHandler | undefined; onSeekedCapture?: React.ReactEventHandler | undefined; onSeeking?: React.ReactEventHandler | undefined; onSeekingCapture?: React.ReactEventHandler | undefined; onStalled?: React.ReactEventHandler | undefined; onStalledCapture?: React.ReactEventHandler | undefined; onSuspend?: React.ReactEventHandler | undefined; onSuspendCapture?: React.ReactEventHandler | undefined; onTimeUpdate?: React.ReactEventHandler | undefined; onTimeUpdateCapture?: React.ReactEventHandler | undefined; onVolumeChange?: React.ReactEventHandler | undefined; onVolumeChangeCapture?: React.ReactEventHandler | undefined; onWaiting?: React.ReactEventHandler | undefined; onWaitingCapture?: React.ReactEventHandler | undefined; onAuxClick?: React.MouseEventHandler | undefined; onAuxClickCapture?: React.MouseEventHandler | undefined; onClick?: React.MouseEventHandler | undefined; onClickCapture?: React.MouseEventHandler | undefined; onContextMenu?: React.MouseEventHandler | undefined; onContextMenuCapture?: React.MouseEventHandler | undefined; onDoubleClick?: React.MouseEventHandler | undefined; onDoubleClickCapture?: React.MouseEventHandler | undefined; onDrag?: React.DragEventHandler | undefined; onDragCapture?: React.DragEventHandler | undefined; onDragEnd?: React.DragEventHandler | undefined; onDragEndCapture?: React.DragEventHandler | undefined; onDragEnter?: React.DragEventHandler | undefined; onDragEnterCapture?: React.DragEventHandler | undefined; onDragExit?: React.DragEventHandler | undefined; onDragExitCapture?: React.DragEventHandler | undefined; onDragLeave?: React.DragEventHandler | undefined; onDragLeaveCapture?: React.DragEventHandler | undefined; onDragOver?: React.DragEventHandler | undefined; onDragOverCapture?: React.DragEventHandler | undefined; onDragStart?: React.DragEventHandler | undefined; onDragStartCapture?: React.DragEventHandler | undefined; onDrop?: React.DragEventHandler | undefined; onDropCapture?: React.DragEventHandler | undefined; onMouseDown?: React.MouseEventHandler | undefined; onMouseDownCapture?: React.MouseEventHandler | undefined; onMouseEnter?: React.MouseEventHandler | undefined; onMouseLeave?: React.MouseEventHandler | undefined; onMouseMove?: React.MouseEventHandler | undefined; onMouseMoveCapture?: React.MouseEventHandler | undefined; onMouseOut?: React.MouseEventHandler | undefined; onMouseOutCapture?: React.MouseEventHandler | undefined; onMouseOver?: React.MouseEventHandler | undefined; onMouseOverCapture?: React.MouseEventHandler | undefined; onMouseUp?: React.MouseEventHandler | undefined; onMouseUpCapture?: React.MouseEventHandler | undefined; onSelect?: React.ReactEventHandler | undefined; onSelectCapture?: React.ReactEventHandler | undefined; onTouchCancel?: React.TouchEventHandler | undefined; onTouchCancelCapture?: React.TouchEventHandler | undefined; onTouchEnd?: React.TouchEventHandler | undefined; onTouchEndCapture?: React.TouchEventHandler | undefined; onTouchMove?: React.TouchEventHandler | undefined; onTouchMoveCapture?: React.TouchEventHandler | undefined; onTouchStart?: React.TouchEventHandler | undefined; onTouchStartCapture?: React.TouchEventHandler | undefined; onPointerDown?: React.PointerEventHandler | undefined; onPointerDownCapture?: React.PointerEventHandler | undefined; onPointerMove?: React.PointerEventHandler | undefined; onPointerMoveCapture?: React.PointerEventHandler | undefined; onPointerUp?: React.PointerEventHandler | undefined; onPointerUpCapture?: React.PointerEventHandler | undefined; onPointerCancel?: React.PointerEventHandler | undefined; onPointerCancelCapture?: React.PointerEventHandler | undefined; onPointerEnter?: React.PointerEventHandler | undefined; onPointerEnterCapture?: React.PointerEventHandler | undefined; onPointerLeave?: React.PointerEventHandler | undefined; onPointerLeaveCapture?: React.PointerEventHandler | undefined; onPointerOver?: React.PointerEventHandler | undefined; onPointerOverCapture?: React.PointerEventHandler | undefined; onPointerOut?: React.PointerEventHandler | undefined; onPointerOutCapture?: React.PointerEventHandler | undefined; onGotPointerCapture?: React.PointerEventHandler | undefined; onGotPointerCaptureCapture?: React.PointerEventHandler | undefined; onLostPointerCapture?: React.PointerEventHandler | undefined; onLostPointerCaptureCapture?: React.PointerEventHandler | undefined; onScroll?: React.UIEventHandler | undefined; onScrollCapture?: React.UIEventHandler | undefined; onWheel?: React.WheelEventHandler | undefined; onWheelCapture?: React.WheelEventHandler | undefined; onAnimationStart?: React.AnimationEventHandler | undefined; onAnimationStartCapture?: React.AnimationEventHandler | undefined; onAnimationEnd?: React.AnimationEventHandler | undefined; onAnimationEndCapture?: React.AnimationEventHandler | undefined; onAnimationIteration?: React.AnimationEventHandler | undefined; onAnimationIterationCapture?: React.AnimationEventHandler | undefined; onTransitionEnd?: React.TransitionEventHandler | undefined; onTransitionEndCapture?: React.TransitionEventHandler | undefined; 'data-test-subj'?: string | undefined; title?: string | undefined; render?: ((value: any, record: ", + "{ children?: React.ReactNode; onError?: React.ReactEventHandler | undefined; render?: ((value: any, record: ", { "pluginId": "savedObjectsManagement", "scope": "public", @@ -286,7 +286,7 @@ "section": "def-public.SavedObjectsManagementRecord", "text": "SavedObjectsManagementRecord" }, - ") => React.ReactNode) | undefined; hidden?: boolean | undefined; description?: string | undefined; security?: string | undefined; field: (string & {}) | keyof ", + ") => React.ReactNode) | undefined; hidden?: boolean | undefined; color?: string | undefined; className?: string | undefined; title?: string | undefined; onChange?: React.FormEventHandler | undefined; onKeyDown?: React.KeyboardEventHandler | undefined; onClick?: React.MouseEventHandler | undefined; id?: string | undefined; description?: string | undefined; security?: string | undefined; name: React.ReactNode; field: (string & {}) | keyof ", { "pluginId": "savedObjectsManagement", "scope": "public", @@ -294,7 +294,7 @@ "section": "def-public.SavedObjectsManagementRecord", "text": "SavedObjectsManagementRecord" }, - "; defaultValue?: string | number | readonly string[] | undefined; defaultChecked?: boolean | undefined; suppressContentEditableWarning?: boolean | undefined; suppressHydrationWarning?: boolean | undefined; accessKey?: string | undefined; contentEditable?: \"inherit\" | Booleanish | undefined; contextMenu?: string | undefined; dir?: string | undefined; draggable?: Booleanish | undefined; placeholder?: string | undefined; slot?: string | undefined; spellCheck?: Booleanish | undefined; translate?: \"no\" | \"yes\" | undefined; radioGroup?: string | undefined; about?: string | undefined; datatype?: string | undefined; inlist?: any; prefix?: string | undefined; property?: string | undefined; resource?: string | undefined; typeof?: string | undefined; vocab?: string | undefined; autoCapitalize?: string | undefined; autoCorrect?: string | undefined; autoSave?: string | undefined; itemProp?: string | undefined; itemScope?: boolean | undefined; itemType?: string | undefined; itemID?: string | undefined; itemRef?: string | undefined; results?: number | undefined; unselectable?: \"off\" | \"on\" | undefined; inputMode?: \"none\" | \"text\" | \"search\" | \"email\" | \"tel\" | \"url\" | \"numeric\" | \"decimal\" | undefined; is?: string | undefined; readOnly?: boolean | undefined; align?: ", + "; defaultValue?: string | number | readonly string[] | undefined; lang?: string | undefined; defaultChecked?: boolean | undefined; suppressContentEditableWarning?: boolean | undefined; suppressHydrationWarning?: boolean | undefined; accessKey?: string | undefined; contentEditable?: \"inherit\" | Booleanish | undefined; contextMenu?: string | undefined; dir?: string | undefined; draggable?: Booleanish | undefined; placeholder?: string | undefined; slot?: string | undefined; spellCheck?: Booleanish | undefined; style?: React.CSSProperties | undefined; tabIndex?: number | undefined; translate?: \"no\" | \"yes\" | undefined; radioGroup?: string | undefined; role?: React.AriaRole | undefined; about?: string | undefined; datatype?: string | undefined; inlist?: any; prefix?: string | undefined; property?: string | undefined; resource?: string | undefined; typeof?: string | undefined; vocab?: string | undefined; autoCapitalize?: string | undefined; autoCorrect?: string | undefined; autoSave?: string | undefined; itemProp?: string | undefined; itemScope?: boolean | undefined; itemType?: string | undefined; itemID?: string | undefined; itemRef?: string | undefined; results?: number | undefined; unselectable?: \"on\" | \"off\" | undefined; inputMode?: \"none\" | \"email\" | \"search\" | \"text\" | \"tel\" | \"url\" | \"numeric\" | \"decimal\" | undefined; is?: string | undefined; 'aria-activedescendant'?: string | undefined; 'aria-atomic'?: boolean | \"false\" | \"true\" | undefined; 'aria-autocomplete'?: \"none\" | \"list\" | \"inline\" | \"both\" | undefined; 'aria-busy'?: boolean | \"false\" | \"true\" | undefined; 'aria-checked'?: boolean | \"mixed\" | \"false\" | \"true\" | undefined; 'aria-colcount'?: number | undefined; 'aria-colindex'?: number | undefined; 'aria-colspan'?: number | undefined; 'aria-controls'?: string | undefined; 'aria-current'?: boolean | \"date\" | \"location\" | \"time\" | \"page\" | \"false\" | \"true\" | \"step\" | undefined; 'aria-describedby'?: string | undefined; 'aria-details'?: string | undefined; 'aria-disabled'?: boolean | \"false\" | \"true\" | undefined; 'aria-dropeffect'?: \"none\" | \"copy\" | \"link\" | \"execute\" | \"move\" | \"popup\" | undefined; 'aria-errormessage'?: string | undefined; 'aria-expanded'?: boolean | \"false\" | \"true\" | undefined; 'aria-flowto'?: string | undefined; 'aria-grabbed'?: boolean | \"false\" | \"true\" | undefined; 'aria-haspopup'?: boolean | \"grid\" | \"menu\" | \"false\" | \"true\" | \"dialog\" | \"listbox\" | \"tree\" | undefined; 'aria-hidden'?: boolean | \"false\" | \"true\" | undefined; 'aria-invalid'?: boolean | \"false\" | \"true\" | \"grammar\" | \"spelling\" | undefined; 'aria-keyshortcuts'?: string | undefined; 'aria-label'?: string | undefined; 'aria-labelledby'?: string | undefined; 'aria-level'?: number | undefined; 'aria-live'?: \"off\" | \"assertive\" | \"polite\" | undefined; 'aria-modal'?: boolean | \"false\" | \"true\" | undefined; 'aria-multiline'?: boolean | \"false\" | \"true\" | undefined; 'aria-multiselectable'?: boolean | \"false\" | \"true\" | undefined; 'aria-orientation'?: \"horizontal\" | \"vertical\" | undefined; 'aria-owns'?: string | undefined; 'aria-placeholder'?: string | undefined; 'aria-posinset'?: number | undefined; 'aria-pressed'?: boolean | \"mixed\" | \"false\" | \"true\" | undefined; 'aria-readonly'?: boolean | \"false\" | \"true\" | undefined; 'aria-relevant'?: \"all\" | \"text\" | \"additions\" | \"additions removals\" | \"additions text\" | \"removals\" | \"removals additions\" | \"removals text\" | \"text additions\" | \"text removals\" | undefined; 'aria-required'?: boolean | \"false\" | \"true\" | undefined; 'aria-roledescription'?: string | undefined; 'aria-rowcount'?: number | undefined; 'aria-rowindex'?: number | undefined; 'aria-rowspan'?: number | undefined; 'aria-selected'?: boolean | \"false\" | \"true\" | undefined; 'aria-setsize'?: number | undefined; 'aria-sort'?: \"none\" | \"other\" | \"ascending\" | \"descending\" | undefined; 'aria-valuemax'?: number | undefined; 'aria-valuemin'?: number | undefined; 'aria-valuenow'?: number | undefined; 'aria-valuetext'?: string | undefined; dangerouslySetInnerHTML?: { __html: string; } | undefined; onCopy?: React.ClipboardEventHandler | undefined; onCopyCapture?: React.ClipboardEventHandler | undefined; onCut?: React.ClipboardEventHandler | undefined; onCutCapture?: React.ClipboardEventHandler | undefined; onPaste?: React.ClipboardEventHandler | undefined; onPasteCapture?: React.ClipboardEventHandler | undefined; onCompositionEnd?: React.CompositionEventHandler | undefined; onCompositionEndCapture?: React.CompositionEventHandler | undefined; onCompositionStart?: React.CompositionEventHandler | undefined; onCompositionStartCapture?: React.CompositionEventHandler | undefined; onCompositionUpdate?: React.CompositionEventHandler | undefined; onCompositionUpdateCapture?: React.CompositionEventHandler | undefined; onFocus?: React.FocusEventHandler | undefined; onFocusCapture?: React.FocusEventHandler | undefined; onBlur?: React.FocusEventHandler | undefined; onBlurCapture?: React.FocusEventHandler | undefined; onChangeCapture?: React.FormEventHandler | undefined; onBeforeInput?: React.FormEventHandler | undefined; onBeforeInputCapture?: React.FormEventHandler | undefined; onInput?: React.FormEventHandler | undefined; onInputCapture?: React.FormEventHandler | undefined; onReset?: React.FormEventHandler | undefined; onResetCapture?: React.FormEventHandler | undefined; onSubmit?: React.FormEventHandler | undefined; onSubmitCapture?: React.FormEventHandler | undefined; onInvalid?: React.FormEventHandler | undefined; onInvalidCapture?: React.FormEventHandler | undefined; onLoad?: React.ReactEventHandler | undefined; onLoadCapture?: React.ReactEventHandler | undefined; onErrorCapture?: React.ReactEventHandler | undefined; onKeyDownCapture?: React.KeyboardEventHandler | undefined; onKeyPress?: React.KeyboardEventHandler | undefined; onKeyPressCapture?: React.KeyboardEventHandler | undefined; onKeyUp?: React.KeyboardEventHandler | undefined; onKeyUpCapture?: React.KeyboardEventHandler | undefined; onAbort?: React.ReactEventHandler | undefined; onAbortCapture?: React.ReactEventHandler | undefined; onCanPlay?: React.ReactEventHandler | undefined; onCanPlayCapture?: React.ReactEventHandler | undefined; onCanPlayThrough?: React.ReactEventHandler | undefined; onCanPlayThroughCapture?: React.ReactEventHandler | undefined; onDurationChange?: React.ReactEventHandler | undefined; onDurationChangeCapture?: React.ReactEventHandler | undefined; onEmptied?: React.ReactEventHandler | undefined; onEmptiedCapture?: React.ReactEventHandler | undefined; onEncrypted?: React.ReactEventHandler | undefined; onEncryptedCapture?: React.ReactEventHandler | undefined; onEnded?: React.ReactEventHandler | undefined; onEndedCapture?: React.ReactEventHandler | undefined; onLoadedData?: React.ReactEventHandler | undefined; onLoadedDataCapture?: React.ReactEventHandler | undefined; onLoadedMetadata?: React.ReactEventHandler | undefined; onLoadedMetadataCapture?: React.ReactEventHandler | undefined; onLoadStart?: React.ReactEventHandler | undefined; onLoadStartCapture?: React.ReactEventHandler | undefined; onPause?: React.ReactEventHandler | undefined; onPauseCapture?: React.ReactEventHandler | undefined; onPlay?: React.ReactEventHandler | undefined; onPlayCapture?: React.ReactEventHandler | undefined; onPlaying?: React.ReactEventHandler | undefined; onPlayingCapture?: React.ReactEventHandler | undefined; onProgress?: React.ReactEventHandler | undefined; onProgressCapture?: React.ReactEventHandler | undefined; onRateChange?: React.ReactEventHandler | undefined; onRateChangeCapture?: React.ReactEventHandler | undefined; onSeeked?: React.ReactEventHandler | undefined; onSeekedCapture?: React.ReactEventHandler | undefined; onSeeking?: React.ReactEventHandler | undefined; onSeekingCapture?: React.ReactEventHandler | undefined; onStalled?: React.ReactEventHandler | undefined; onStalledCapture?: React.ReactEventHandler | undefined; onSuspend?: React.ReactEventHandler | undefined; onSuspendCapture?: React.ReactEventHandler | undefined; onTimeUpdate?: React.ReactEventHandler | undefined; onTimeUpdateCapture?: React.ReactEventHandler | undefined; onVolumeChange?: React.ReactEventHandler | undefined; onVolumeChangeCapture?: React.ReactEventHandler | undefined; onWaiting?: React.ReactEventHandler | undefined; onWaitingCapture?: React.ReactEventHandler | undefined; onAuxClick?: React.MouseEventHandler | undefined; onAuxClickCapture?: React.MouseEventHandler | undefined; onClickCapture?: React.MouseEventHandler | undefined; onContextMenu?: React.MouseEventHandler | undefined; onContextMenuCapture?: React.MouseEventHandler | undefined; onDoubleClick?: React.MouseEventHandler | undefined; onDoubleClickCapture?: React.MouseEventHandler | undefined; onDrag?: React.DragEventHandler | undefined; onDragCapture?: React.DragEventHandler | undefined; onDragEnd?: React.DragEventHandler | undefined; onDragEndCapture?: React.DragEventHandler | undefined; onDragEnter?: React.DragEventHandler | undefined; onDragEnterCapture?: React.DragEventHandler | undefined; onDragExit?: React.DragEventHandler | undefined; onDragExitCapture?: React.DragEventHandler | undefined; onDragLeave?: React.DragEventHandler | undefined; onDragLeaveCapture?: React.DragEventHandler | undefined; onDragOver?: React.DragEventHandler | undefined; onDragOverCapture?: React.DragEventHandler | undefined; onDragStart?: React.DragEventHandler | undefined; onDragStartCapture?: React.DragEventHandler | undefined; onDrop?: React.DragEventHandler | undefined; onDropCapture?: React.DragEventHandler | undefined; onMouseDown?: React.MouseEventHandler | undefined; onMouseDownCapture?: React.MouseEventHandler | undefined; onMouseEnter?: React.MouseEventHandler | undefined; onMouseLeave?: React.MouseEventHandler | undefined; onMouseMove?: React.MouseEventHandler | undefined; onMouseMoveCapture?: React.MouseEventHandler | undefined; onMouseOut?: React.MouseEventHandler | undefined; onMouseOutCapture?: React.MouseEventHandler | undefined; onMouseOver?: React.MouseEventHandler | undefined; onMouseOverCapture?: React.MouseEventHandler | undefined; onMouseUp?: React.MouseEventHandler | undefined; onMouseUpCapture?: React.MouseEventHandler | undefined; onSelect?: React.ReactEventHandler | undefined; onSelectCapture?: React.ReactEventHandler | undefined; onTouchCancel?: React.TouchEventHandler | undefined; onTouchCancelCapture?: React.TouchEventHandler | undefined; onTouchEnd?: React.TouchEventHandler | undefined; onTouchEndCapture?: React.TouchEventHandler | undefined; onTouchMove?: React.TouchEventHandler | undefined; onTouchMoveCapture?: React.TouchEventHandler | undefined; onTouchStart?: React.TouchEventHandler | undefined; onTouchStartCapture?: React.TouchEventHandler | undefined; onPointerDown?: React.PointerEventHandler | undefined; onPointerDownCapture?: React.PointerEventHandler | undefined; onPointerMove?: React.PointerEventHandler | undefined; onPointerMoveCapture?: React.PointerEventHandler | undefined; onPointerUp?: React.PointerEventHandler | undefined; onPointerUpCapture?: React.PointerEventHandler | undefined; onPointerCancel?: React.PointerEventHandler | undefined; onPointerCancelCapture?: React.PointerEventHandler | undefined; onPointerEnter?: React.PointerEventHandler | undefined; onPointerEnterCapture?: React.PointerEventHandler | undefined; onPointerLeave?: React.PointerEventHandler | undefined; onPointerLeaveCapture?: React.PointerEventHandler | undefined; onPointerOver?: React.PointerEventHandler | undefined; onPointerOverCapture?: React.PointerEventHandler | undefined; onPointerOut?: React.PointerEventHandler | undefined; onPointerOutCapture?: React.PointerEventHandler | undefined; onGotPointerCapture?: React.PointerEventHandler | undefined; onGotPointerCaptureCapture?: React.PointerEventHandler | undefined; onLostPointerCapture?: React.PointerEventHandler | undefined; onLostPointerCaptureCapture?: React.PointerEventHandler | undefined; onScroll?: React.UIEventHandler | undefined; onScrollCapture?: React.UIEventHandler | undefined; onWheel?: React.WheelEventHandler | undefined; onWheelCapture?: React.WheelEventHandler | undefined; onAnimationStart?: React.AnimationEventHandler | undefined; onAnimationStartCapture?: React.AnimationEventHandler | undefined; onAnimationEnd?: React.AnimationEventHandler | undefined; onAnimationEndCapture?: React.AnimationEventHandler | undefined; onAnimationIteration?: React.AnimationEventHandler | undefined; onAnimationIterationCapture?: React.AnimationEventHandler | undefined; onTransitionEnd?: React.TransitionEventHandler | undefined; onTransitionEndCapture?: React.TransitionEventHandler | undefined; 'data-test-subj'?: string | undefined; height?: string | number | undefined; width?: string | undefined; readOnly?: boolean | undefined; align?: ", "HorizontalAlignment", " | undefined; abbr?: string | undefined; footer?: string | React.ReactElement> | ((props: ", "EuiTableFooterProps", @@ -306,7 +306,7 @@ "section": "def-public.SavedObjectsManagementRecord", "text": "SavedObjectsManagementRecord" }, - ">) => React.ReactNode) | undefined; colSpan?: number | undefined; headers?: string | undefined; rowSpan?: number | undefined; scope?: string | undefined; valign?: \"baseline\" | \"middle\" | \"top\" | \"bottom\" | undefined; dataType?: ", + ">) => React.ReactNode) | undefined; colSpan?: number | undefined; headers?: string | undefined; rowSpan?: number | undefined; scope?: string | undefined; valign?: \"top\" | \"bottom\" | \"middle\" | \"baseline\" | undefined; dataType?: ", "EuiTableDataType", " | undefined; isExpander?: boolean | undefined; textOnly?: boolean | undefined; truncateText?: boolean | undefined; mobileOptions?: (Omit<", "EuiTableRowCellMobileOptionsShape", diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index 5d6e47e63c14d..29d91d20cf02b 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsManagement title: "savedObjectsManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsManagement plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] --- import savedObjectsManagementObj from './saved_objects_management.devdocs.json'; diff --git a/api_docs/saved_objects_tagging.devdocs.json b/api_docs/saved_objects_tagging.devdocs.json index 2cc307c5a8bb8..0ed05dcb1409e 100644 --- a/api_docs/saved_objects_tagging.devdocs.json +++ b/api_docs/saved_objects_tagging.devdocs.json @@ -1173,7 +1173,7 @@ "label": "errors", "description": [], "signature": [ - "{ color?: string | undefined; id?: string | undefined; name?: string | undefined; description?: string | undefined; }" + "{ color?: string | undefined; id?: string | undefined; description?: string | undefined; name?: string | undefined; }" ], "path": "x-pack/plugins/saved_objects_tagging/common/validation.ts", "deprecated": false diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index 6221e1a9eb609..2c33fd3715fab 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTagging title: "savedObjectsTagging" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTagging plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] --- import savedObjectsTaggingObj from './saved_objects_tagging.devdocs.json'; diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index 63dfadbfab1d5..6c061694de3e2 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTaggingOss title: "savedObjectsTaggingOss" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTaggingOss plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] --- import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.devdocs.json'; diff --git a/api_docs/saved_search.mdx b/api_docs/saved_search.mdx index 37ca9b6297f91..f4c21e0a52ea2 100644 --- a/api_docs/saved_search.mdx +++ b/api_docs/saved_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedSearch title: "savedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the savedSearch plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedSearch'] --- import savedSearchObj from './saved_search.devdocs.json'; diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index 3e6e3c71a67b7..98da263297266 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotMode title: "screenshotMode" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotMode plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotMode'] --- import screenshotModeObj from './screenshot_mode.devdocs.json'; diff --git a/api_docs/screenshotting.mdx b/api_docs/screenshotting.mdx index 00369b3ff22d7..2860839da32dd 100644 --- a/api_docs/screenshotting.mdx +++ b/api_docs/screenshotting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotting title: "screenshotting" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotting plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 89a897adf344b..37faaa1366ca3 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/security title: "security" image: https://source.unsplash.com/400x175/?github description: API docs for the security plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] --- import securityObj from './security.devdocs.json'; diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index 9bc47372e8bdd..b9a7017fba830 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolution title: "securitySolution" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolution plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] --- import securitySolutionObj from './security_solution.devdocs.json'; diff --git a/api_docs/session_view.mdx b/api_docs/session_view.mdx index 73a7a69ba45a8..a320d389f9018 100644 --- a/api_docs/session_view.mdx +++ b/api_docs/session_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/sessionView title: "sessionView" image: https://source.unsplash.com/400x175/?github description: API docs for the sessionView plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sessionView'] --- import sessionViewObj from './session_view.devdocs.json'; diff --git a/api_docs/share.mdx b/api_docs/share.mdx index ab11a444b7c9f..fb374a526cb8c 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/share title: "share" image: https://source.unsplash.com/400x175/?github description: API docs for the share plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] --- import shareObj from './share.devdocs.json'; diff --git a/api_docs/shared_u_x.devdocs.json b/api_docs/shared_u_x.devdocs.json deleted file mode 100644 index 948d6b212ebf8..0000000000000 --- a/api_docs/shared_u_x.devdocs.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "id": "sharedUX", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [], - "start": { - "parentPluginId": "sharedUX", - "id": "def-public.SharedUXPluginStart", - "type": "Interface", - "tags": [], - "label": "SharedUXPluginStart", - "description": [ - "\nThe Shared UX plugin public contract, containing prewired components, services, and\nother constructs useful to consumers." - ], - "path": "src/plugins/shared_ux/public/types/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "sharedUX", - "id": "def-public.SharedUXPluginStart.getContextServices", - "type": "Function", - "tags": [], - "label": "getContextServices", - "description": [ - "\nA set of pre-wired services for use with `SharedUxServicesProvider`.\n\n```\nimport { SharedUxServicesProvider } from '@kbn/shared-ux-services';\n\npublic start(coreStart: CoreStart, startPlugins: MyPluginStartDeps): MyPluginStart {\n const services = startPlugins.sharedUX.getContextServices();\n return {\n ServicesContext: ({ children }) => {children},\n };\n}\n```\n\nor\n\n```\nimport { SharedUxServicesProvider } from '@kbn/shared-ux-services';\n\npublic setup(coreSetup: CoreSetup, setupPlugins: MyPluginSetupDeps): MyPluginSetup {\n const [coreStart, startPlugins] = await coreSetup.getStartServices();\n coreSetup.application.register({\n mount: async (params: AppMountParameters) => {\n ReactDOM.render(\n \n \n ,\n params.element\n );\n }\n );\n}\n```" - ], - "signature": [ - "() => ", - "SharedUxServices" - ], - "path": "src/plugins/shared_ux/public/types/index.ts", - "deprecated": false, - "children": [], - "returnComment": [] - } - ], - "lifecycle": "start", - "initialIsOpen": true - } - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [ - { - "parentPluginId": "sharedUX", - "id": "def-common.PLUGIN_ID", - "type": "string", - "tags": [], - "label": "PLUGIN_ID", - "description": [ - "The ID of the Shared UX plugin." - ], - "signature": [ - "\"sharedUX\"" - ], - "path": "src/plugins/shared_ux/common/index.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "sharedUX", - "id": "def-common.PLUGIN_NAME", - "type": "string", - "tags": [], - "label": "PLUGIN_NAME", - "description": [ - "The name of the Shared UX plugin." - ], - "signature": [ - "\"sharedUX\"" - ], - "path": "src/plugins/shared_ux/common/index.ts", - "deprecated": false, - "initialIsOpen": false - } - ], - "objects": [] - } -} \ No newline at end of file diff --git a/api_docs/shared_u_x.mdx b/api_docs/shared_u_x.mdx deleted file mode 100644 index 70ff8ec8ed289..0000000000000 --- a/api_docs/shared_u_x.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -#### -#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. -#### Reach out in #docs-engineering for more info. -#### -id: kibSharedUXPluginApi -slug: /kibana-dev-docs/api/sharedUX -title: "sharedUX" -image: https://source.unsplash.com/400x175/?github -description: API docs for the sharedUX plugin -date: 2022-08-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sharedUX'] ---- -import sharedUXObj from './shared_u_x.devdocs.json'; - -A plugin providing components and services for shared user experiences in Kibana. - -Contact [Shared UX](https://github.com/orgs/elastic/teams/shared-ux) for questions regarding this plugin. - -**Code health stats** - -| Public API count | Any count | Items lacking comments | Missing exports | -|-------------------|-----------|------------------------|-----------------| -| 4 | 0 | 0 | 0 | - -## Client - -### Start - - -## Common - -### Consts, variables and types - - diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index 1c75262284425..4e17deb78c52e 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/snapshotRestore title: "snapshotRestore" image: https://source.unsplash.com/400x175/?github description: API docs for the snapshotRestore plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] --- import snapshotRestoreObj from './snapshot_restore.devdocs.json'; diff --git a/api_docs/spaces.devdocs.json b/api_docs/spaces.devdocs.json index b9471fcdf12a3..16599343be1d9 100644 --- a/api_docs/spaces.devdocs.json +++ b/api_docs/spaces.devdocs.json @@ -1706,7 +1706,7 @@ "The size of the avatar." ], "signature": [ - "\"s\" | \"m\" | \"l\" | \"xl\" | undefined" + "\"m\" | \"s\" | \"l\" | \"xl\" | undefined" ], "path": "x-pack/plugins/spaces/public/space_avatar/types.ts", "deprecated": false diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index 76d90c2084e85..946e1220ffea2 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/spaces title: "spaces" image: https://source.unsplash.com/400x175/?github description: API docs for the spaces plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'spaces'] --- import spacesObj from './spaces.devdocs.json'; diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index 47fe907012996..55cdcac9ab284 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackAlerts title: "stackAlerts" image: https://source.unsplash.com/400x175/?github description: API docs for the stackAlerts plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackAlerts'] --- import stackAlertsObj from './stack_alerts.devdocs.json'; diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 56bd8501098b3..94964f824327b 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/taskManager title: "taskManager" image: https://source.unsplash.com/400x175/?github description: API docs for the taskManager plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] --- import taskManagerObj from './task_manager.devdocs.json'; diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index 78fbcd7216f4c..4a8f0134cfcde 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetry title: "telemetry" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetry plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] --- import telemetryObj from './telemetry.devdocs.json'; diff --git a/api_docs/telemetry_collection_manager.devdocs.json b/api_docs/telemetry_collection_manager.devdocs.json index 4db23391334f0..5d4bfd39478e6 100644 --- a/api_docs/telemetry_collection_manager.devdocs.json +++ b/api_docs/telemetry_collection_manager.devdocs.json @@ -124,7 +124,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -192,7 +190,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -1204,6 +1202,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index 3835339944b91..87dfbce21f830 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionManager title: "telemetryCollectionManager" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionManager plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] --- import telemetryCollectionManagerObj from './telemetry_collection_manager.devdocs.json'; diff --git a/api_docs/telemetry_collection_xpack.mdx b/api_docs/telemetry_collection_xpack.mdx index b1537037498bc..d7c1b6a63da36 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionXpack title: "telemetryCollectionXpack" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionXpack plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionXpack'] --- import telemetryCollectionXpackObj from './telemetry_collection_xpack.devdocs.json'; diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index 3797dfa06c57b..45f696e98e0d6 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryManagementSection title: "telemetryManagementSection" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryManagementSection plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] --- import telemetryManagementSectionObj from './telemetry_management_section.devdocs.json'; diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index 403513bda349b..7846b7583c6ef 100644 --- a/api_docs/threat_intelligence.mdx +++ b/api_docs/threat_intelligence.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/threatIntelligence title: "threatIntelligence" image: https://source.unsplash.com/400x175/?github description: API docs for the threatIntelligence plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'threatIntelligence'] --- import threatIntelligenceObj from './threat_intelligence.devdocs.json'; diff --git a/api_docs/timelines.devdocs.json b/api_docs/timelines.devdocs.json index 907c3864fb24d..8172c6d16cbe6 100644 --- a/api_docs/timelines.devdocs.json +++ b/api_docs/timelines.devdocs.json @@ -772,7 +772,7 @@ "EuiDataGridColumn", ", \"id\" | \"display\" | \"displayAsText\" | \"initialWidth\"> & Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"schema\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"actions\" | \"display\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", "TGridCellAction", "[] | undefined; category?: string | undefined; columnHeaderType: ", { @@ -804,7 +804,7 @@ "EuiDataGridColumn", ", \"id\" | \"display\" | \"displayAsText\" | \"initialWidth\"> & Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"schema\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"actions\" | \"display\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", "TGridCellAction", "[] | undefined; category?: string | undefined; columnHeaderType: ", { @@ -2302,7 +2302,7 @@ "EuiDataGridColumn", ", \"id\" | \"display\" | \"displayAsText\" | \"initialWidth\"> & Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"schema\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"actions\" | \"display\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", "TGridCellAction", "[] | undefined; category?: string | undefined; columnHeaderType: ", { @@ -2849,11 +2849,11 @@ "label": "TGridModelForTimeline", "description": [], "signature": [ - "{ id: string; version: string | null; title: string; columns: (Pick<", + "{ columns: (Pick<", "EuiDataGridColumn", ", \"id\" | \"display\" | \"displayAsText\" | \"initialWidth\"> & Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"schema\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"actions\" | \"display\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", "TGridCellAction", "[] | undefined; category?: string | undefined; columnHeaderType: ", { @@ -2865,11 +2865,11 @@ }, "; description?: string | null | undefined; esTypes?: string[] | undefined; example?: string | number | null | undefined; format?: string | undefined; linkField?: string | undefined; placeholder?: string | undefined; subType?: ", "IFieldSubType", - " | undefined; type?: string | undefined; })[]; filters?: ", + " | undefined; type?: string | undefined; })[]; title: string; id: string; filters?: ", "Filter", "[] | undefined; dataViewId: string | null; sort: ", "SortColumnTimeline", - "[]; filterManager?: ", + "[]; version: string | null; filterManager?: ", { "pluginId": "data", "scope": "public", @@ -2881,7 +2881,7 @@ "EuiDataGridColumn", ", \"id\" | \"display\" | \"displayAsText\" | \"initialWidth\"> & Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"schema\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"actions\" | \"display\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", "TGridCellAction", "[] | undefined; category?: string | undefined; columnHeaderType: ", { @@ -3981,7 +3981,7 @@ "signature": [ "Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"schema\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"actions\" | \"display\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", "TGridCellAction", "[] | undefined; category?: string | undefined; columnHeaderType: ", { @@ -6542,7 +6542,7 @@ "signature": [ "Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"schema\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"actions\" | \"display\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", "TGridCellAction", "[] | undefined; category?: string | undefined; columnHeaderType: ", { diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index 42ebb099ae644..c8e373f2e9f61 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/timelines title: "timelines" image: https://source.unsplash.com/400x175/?github description: API docs for the timelines plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] --- import timelinesObj from './timelines.devdocs.json'; diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index 2ad3d72d1b520..06540db67aba9 100644 --- a/api_docs/transform.mdx +++ b/api_docs/transform.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/transform title: "transform" image: https://source.unsplash.com/400x175/?github description: API docs for the transform plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] --- import transformObj from './transform.devdocs.json'; diff --git a/api_docs/triggers_actions_ui.devdocs.json b/api_docs/triggers_actions_ui.devdocs.json index efe1dc16a1b3f..e8db880ec5e91 100644 --- a/api_docs/triggers_actions_ui.devdocs.json +++ b/api_docs/triggers_actions_ui.devdocs.json @@ -1508,7 +1508,7 @@ "label": "suspendedComponentWithProps", "description": [], "signature": [ - "(ComponentToSuspend: React.ComponentType, size: \"s\" | \"m\" | \"l\" | \"xl\" | \"xxl\" | undefined) => (props: T) => JSX.Element" + "(ComponentToSuspend: React.ComponentType, size: \"m\" | \"s\" | \"l\" | \"xl\" | \"xxl\" | undefined) => (props: T) => JSX.Element" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/suspended_component_with_props.tsx", "deprecated": false, @@ -1535,7 +1535,7 @@ "label": "size", "description": [], "signature": [ - "\"s\" | \"m\" | \"l\" | \"xl\" | \"xxl\" | undefined" + "\"m\" | \"s\" | \"l\" | \"xl\" | \"xxl\" | undefined" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/suspended_component_with_props.tsx", "deprecated": false, @@ -2071,7 +2071,7 @@ "label": "flyoutSize", "description": [], "signature": [ - "\"s\" | \"m\" | \"l\" | undefined" + "\"m\" | \"s\" | \"l\" | undefined" ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", "deprecated": false @@ -3596,7 +3596,7 @@ "label": "setRuleProperty", "description": [], "signature": [ - "(key: Prop, value: ", + "(key: Prop, value: ", "SanitizedRule", "[Prop] | null) => void" ], diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index 41d6cb580445a..9c5644e43758a 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/triggersActionsUi title: "triggersActionsUi" image: https://source.unsplash.com/400x175/?github description: API docs for the triggersActionsUi plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] --- import triggersActionsUiObj from './triggers_actions_ui.devdocs.json'; diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index 0f81ee1f3480e..3344aedd4590a 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActions title: "uiActions" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActions plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActions'] --- import uiActionsObj from './ui_actions.devdocs.json'; diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index 262c841c99b54..503cd435c1a62 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActionsEnhanced title: "uiActionsEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActionsEnhanced plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] --- import uiActionsEnhancedObj from './ui_actions_enhanced.devdocs.json'; diff --git a/api_docs/unified_search.devdocs.json b/api_docs/unified_search.devdocs.json index 86e9771981ed8..2e8d4636df681 100644 --- a/api_docs/unified_search.devdocs.json +++ b/api_docs/unified_search.devdocs.json @@ -407,12 +407,35 @@ { "parentPluginId": "unifiedSearch", "id": "def-public.ApplyGlobalFilterActionContext.embeddable", - "type": "Unknown", + "type": "Object", "tags": [], "label": "embeddable", "description": [], "signature": [ - "unknown" + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.IEmbeddable", + "text": "IEmbeddable" + }, + "<", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableInput", + "text": "EmbeddableInput" + }, + ", ", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.EmbeddableOutput", + "text": "EmbeddableOutput" + }, + "> | undefined" ], "path": "src/plugins/unified_search/public/actions/apply_filter_action.ts", "deprecated": false diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index 10281e531f483..64f0d6ae8d7ce 100644 --- a/api_docs/unified_search.mdx +++ b/api_docs/unified_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch title: "unifiedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch'] --- import unifiedSearchObj from './unified_search.devdocs.json'; diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index 01cc1607a7e7a..ba1c3c375e317 100644 --- a/api_docs/unified_search_autocomplete.mdx +++ b/api_docs/unified_search_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch-autocomplete title: "unifiedSearch.autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch.autocomplete plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] --- import unifiedSearchAutocompleteObj from './unified_search_autocomplete.devdocs.json'; diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index b70a815d8ba09..86c118c1c8db7 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github description: API docs for the urlForwarding plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] --- import urlForwardingObj from './url_forwarding.devdocs.json'; diff --git a/api_docs/usage_collection.devdocs.json b/api_docs/usage_collection.devdocs.json index 40cf1b6dde66b..fc4e370e41c2f 100644 --- a/api_docs/usage_collection.devdocs.json +++ b/api_docs/usage_collection.devdocs.json @@ -378,7 +378,9 @@ "TransportRequestOptions", " | undefined): Promise<", "WriteResponseBase", - ">; }; name: string | symbol; transform: ", + ">; }; cluster: ", + "default", + "; eql: ", "default", "; search: { >; }; cluster: ", - "default", - "; eql: ", - "default", - "; create: { (this: That, params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", @@ -446,7 +444,7 @@ "default", "; security: ", "default", - "; index: { (this: That, params: ", + "; name: string | symbol; index: { (this: That, params: ", "IndexRequest", " | ", "IndexRequest", @@ -1458,6 +1456,8 @@ "TermvectorsResponse", ">; }; textStructure: ", "default", + "; transform: ", + "default", "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", @@ -1866,7 +1866,7 @@ "\nPossible type values in the schema" ], "signature": [ - "\"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"short\" | \"float\" | \"integer\" | \"byte\"" + "\"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"short\" | \"float\" | \"integer\" | \"byte\"" ], "path": "node_modules/@types/kbn__analytics-client/index.d.ts", "deprecated": false, diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 77b2c55155762..f807def63b4a7 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/usageCollection title: "usageCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the usageCollection plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index 6d24ae729b420..50b3264a3818d 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github description: API docs for the ux plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] --- import uxObj from './ux.devdocs.json'; diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index e87885bef3844..9b58b7dbfb92a 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the visDefaultEditor plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] --- import visDefaultEditorObj from './vis_default_editor.devdocs.json'; diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index 606521372de1c..2b78f7f5bd11d 100644 --- a/api_docs/vis_type_gauge.mdx +++ b/api_docs/vis_type_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeGauge title: "visTypeGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeGauge plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeGauge'] --- import visTypeGaugeObj from './vis_type_gauge.devdocs.json'; diff --git a/api_docs/vis_type_heatmap.mdx b/api_docs/vis_type_heatmap.mdx index e27f00e00cb87..51a8f40a7aac4 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeHeatmap plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeHeatmap'] --- import visTypeHeatmapObj from './vis_type_heatmap.devdocs.json'; diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index b4b157c05b9fa..da4917cdfe030 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypePie plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypePie'] --- import visTypePieObj from './vis_type_pie.devdocs.json'; diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index 2bdbe1b25386a..840f586427643 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTable plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTable'] --- import visTypeTableObj from './vis_type_table.devdocs.json'; diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index cca4d0eb48a3f..6b73405739b4b 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimelion plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimelion'] --- import visTypeTimelionObj from './vis_type_timelion.devdocs.json'; diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index dc622d886f303..3f6284c0d0c29 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimeseries plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimeseries'] --- import visTypeTimeseriesObj from './vis_type_timeseries.devdocs.json'; diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index 44017c1592c3c..1c42f4125d7c6 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVega plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVega'] --- import visTypeVegaObj from './vis_type_vega.devdocs.json'; diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index 824394e5e501c..25fcfb9665a95 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVislib plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] --- import visTypeVislibObj from './vis_type_vislib.devdocs.json'; diff --git a/api_docs/vis_type_xy.devdocs.json b/api_docs/vis_type_xy.devdocs.json index 26e0033116122..ec7c7d42c4201 100644 --- a/api_docs/vis_type_xy.devdocs.json +++ b/api_docs/vis_type_xy.devdocs.json @@ -3,39 +3,6 @@ "client": { "classes": [], "functions": [ - { - "parentPluginId": "visTypeXy", - "id": "def-public.getAggId", - "type": "Function", - "tags": [], - "label": "getAggId", - "description": [ - "\nGet agg id from accessor\n\nFor now this is determined by the esaggs column name. Could be cleaned up in the future." - ], - "signature": [ - "(accessor: string) => string" - ], - "path": "src/plugins/vis_types/xy/public/config/get_agg_id.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "visTypeXy", - "id": "def-public.getAggId.$1", - "type": "string", - "tags": [], - "label": "accessor", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/vis_types/xy/public/config/get_agg_id.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "visTypeXy", "id": "def-public.getPositions", @@ -824,29 +791,6 @@ "path": "src/plugins/vis_types/xy/public/types/param.ts", "deprecated": false, "initialIsOpen": false - }, - { - "parentPluginId": "visTypeXy", - "id": "def-public.XyVisType", - "type": "Type", - "tags": [], - "label": "XyVisType", - "description": [ - "\nType of xy visualizations" - ], - "signature": [ - { - "pluginId": "visTypeXy", - "scope": "common", - "docId": "kibVisTypeXyPluginApi", - "section": "def-common.ChartType", - "text": "ChartType" - }, - " | \"horizontal_bar\"" - ], - "path": "src/plugins/vis_types/xy/common/index.ts", - "deprecated": false, - "initialIsOpen": false } ], "objects": [], @@ -891,31 +835,7 @@ "initialIsOpen": false } ], - "misc": [ - { - "parentPluginId": "visTypeXy", - "id": "def-common.XyVisType", - "type": "Type", - "tags": [], - "label": "XyVisType", - "description": [ - "\nType of xy visualizations" - ], - "signature": [ - { - "pluginId": "visTypeXy", - "scope": "common", - "docId": "kibVisTypeXyPluginApi", - "section": "def-common.ChartType", - "text": "ChartType" - }, - " | \"horizontal_bar\"" - ], - "path": "src/plugins/vis_types/xy/common/index.ts", - "deprecated": false, - "initialIsOpen": false - } - ], + "misc": [], "objects": [] } } \ No newline at end of file diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index d2f873fbd2f71..e311b30da528e 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeXy plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] --- import visTypeXyObj from './vis_type_xy.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 57 | 0 | 51 | 5 | +| 53 | 0 | 50 | 5 | ## Client @@ -45,6 +45,3 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) ### Enums -### Consts, variables and types - - diff --git a/api_docs/visualizations.devdocs.json b/api_docs/visualizations.devdocs.json index 5931d92077178..c706825202fd6 100644 --- a/api_docs/visualizations.devdocs.json +++ b/api_docs/visualizations.devdocs.json @@ -1157,6 +1157,694 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable", + "type": "Class", + "tags": [], + "label": "VisualizeEmbeddable", + "description": [], + "signature": [ + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeEmbeddable", + "text": "VisualizeEmbeddable" + }, + " extends ", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.Embeddable", + "text": "Embeddable" + }, + "<", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeInput", + "text": "VisualizeInput" + }, + ", ", + "VisualizeOutput", + "> implements ", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.ReferenceOrValueEmbeddable", + "text": "ReferenceOrValueEmbeddable" + }, + "<", + "VisualizeByValueInput", + ", ", + "VisualizeByReferenceInput", + ">,", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.FilterableEmbeddable", + "text": "FilterableEmbeddable" + } + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"visualization\"" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "timefilter", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataQueryPluginApi", + "section": "def-public.TimefilterContract", + "text": "TimefilterContract" + } + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.Unnamed.$2", + "type": "Object", + "tags": [], + "label": "{ vis, editPath, editUrl, indexPatterns, deps, capabilities }", + "description": [], + "signature": [ + "VisualizeEmbeddableConfiguration" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.Unnamed.$3", + "type": "Object", + "tags": [], + "label": "initialInput", + "description": [], + "signature": [ + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeInput", + "text": "VisualizeInput" + } + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.Unnamed.$4", + "type": "Object", + "tags": [], + "label": "attributeService", + "description": [], + "signature": [ + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.AttributeService", + "text": "AttributeService" + }, + "<", + "VisualizeSavedObjectAttributes", + ", ", + "VisualizeByValueInput", + ", ", + "VisualizeByReferenceInput", + ", unknown> | undefined" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.Unnamed.$5", + "type": "Object", + "tags": [], + "label": "parent", + "description": [], + "signature": [ + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.IContainer", + "text": "IContainer" + }, + "<{}, ", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.ContainerInput", + "text": "ContainerInput" + }, + "<{}>, ", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.ContainerOutput", + "text": "ContainerOutput" + }, + "> | undefined" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.reportsEmbeddableLoad", + "type": "Function", + "tags": [], + "label": "reportsEmbeddableLoad", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getDescription", + "type": "Function", + "tags": [], + "label": "getDescription", + "description": [], + "signature": [ + "() => string" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getVis", + "type": "Function", + "tags": [], + "label": "getVis", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.Vis", + "text": "Vis" + }, + "<", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.VisParams", + "text": "VisParams" + }, + ">" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getFilters", + "type": "Function", + "tags": [], + "label": "getFilters", + "description": [ + "\nGets the Visualize embeddable's local filters" + ], + "signature": [ + "() => Promise<", + "Filter", + "[]>" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [ + "Local/panel-level array of filters for Visualize embeddable" + ] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getQuery", + "type": "Function", + "tags": [], + "label": "getQuery", + "description": [ + "\nGets the Visualize embeddable's local query" + ], + "signature": [ + "() => Promise<", + "Query", + " | ", + "AggregateQuery", + " | undefined>" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [ + "Local/panel-level query for Visualize embeddable" + ] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getInspectorAdapters", + "type": "Function", + "tags": [], + "label": "getInspectorAdapters", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + " | undefined" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.openInspector", + "type": "Function", + "tags": [], + "label": "openInspector", + "description": [], + "signature": [ + "() => ", + "OverlayRef", + " | undefined" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.transferCustomizationsToUiState", + "type": "Function", + "tags": [], + "label": "transferCustomizationsToUiState", + "description": [ + "\nTransfers all changes in the containerState.customization into\nthe uiState of this visualization." + ], + "signature": [ + "() => void" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.hasInspector", + "type": "Function", + "tags": [], + "label": "hasInspector", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.onContainerLoading", + "type": "Function", + "tags": [], + "label": "onContainerLoading", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.onContainerData", + "type": "Function", + "tags": [], + "label": "onContainerData", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.onContainerRender", + "type": "Function", + "tags": [], + "label": "onContainerRender", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.onContainerError", + "type": "Function", + "tags": [], + "label": "onContainerError", + "description": [], + "signature": [ + "(error: ", + { + "pluginId": "expressions", + "scope": "public", + "docId": "kibExpressionsPluginApi", + "section": "def-public.ExpressionRenderError", + "text": "ExpressionRenderError" + }, + ") => void" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.onContainerError.$1", + "type": "Object", + "tags": [], + "label": "error", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "public", + "docId": "kibExpressionsPluginApi", + "section": "def-public.ExpressionRenderError", + "text": "ExpressionRenderError" + } + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.render", + "type": "Function", + "tags": [], + "label": "render", + "description": [ + "\n" + ], + "signature": [ + "(domNode: HTMLElement) => Promise" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.render.$1", + "type": "Object", + "tags": [], + "label": "domNode", + "description": [], + "signature": [ + "HTMLElement" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.renderError", + "type": "Function", + "tags": [], + "label": "renderError", + "description": [], + "signature": [ + "(domNode: HTMLElement, error: string | ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ErrorLike", + "text": "ErrorLike" + }, + ") => () => boolean" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.renderError.$1", + "type": "Object", + "tags": [], + "label": "domNode", + "description": [], + "signature": [ + "HTMLElement" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.renderError.$2", + "type": "CompoundType", + "tags": [], + "label": "error", + "description": [], + "signature": [ + "string | ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ErrorLike", + "text": "ErrorLike" + } + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.destroy", + "type": "Function", + "tags": [], + "label": "destroy", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.reload", + "type": "Function", + "tags": [], + "label": "reload", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.supportedTriggers", + "type": "Function", + "tags": [], + "label": "supportedTriggers", + "description": [], + "signature": [ + "() => string[]" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.inputIsRefType", + "type": "Function", + "tags": [], + "label": "inputIsRefType", + "description": [], + "signature": [ + "(input: ", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeInput", + "text": "VisualizeInput" + }, + ") => input is ", + "VisualizeByReferenceInput" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.inputIsRefType.$1", + "type": "Object", + "tags": [], + "label": "input", + "description": [], + "signature": [ + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeInput", + "text": "VisualizeInput" + } + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getInputAsValueType", + "type": "Function", + "tags": [], + "label": "getInputAsValueType", + "description": [], + "signature": [ + "() => Promise<", + "VisualizeByValueInput", + ">" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getInputAsRefType", + "type": "Function", + "tags": [], + "label": "getInputAsRefType", + "description": [], + "signature": [ + "() => Promise<", + "VisualizeByReferenceInput", + ">" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false } ], "functions": [ @@ -3084,7 +3772,7 @@ "label": "getDisplayName", "description": [], "signature": [ - "(() => string) | undefined" + "() => string" ], "path": "src/plugins/visualizations/public/types.ts", "deprecated": false, @@ -5125,7 +5813,7 @@ "label": "VisualizeEmbeddableContract", "description": [], "signature": [ - "{ readonly type: \"visualization\"; readonly id: string; render: (domNode: HTMLElement) => Promise; getExplicitInput: () => ", + "{ readonly type: \"visualization\"; render: (domNode: HTMLElement) => Promise; readonly id: string; getExplicitInput: () => ", { "pluginId": "visualizations", "scope": "public", @@ -5169,7 +5857,23 @@ "section": "def-public.VisualizeInput", "text": "VisualizeInput" }, - ">) => void; reportsEmbeddableLoad: () => boolean; getFilters: () => Promise<", + ">) => void; reportsEmbeddableLoad: () => boolean; getVis: () => ", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.Vis", + "text": "Vis" + }, + "<", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.VisParams", + "text": "VisParams" + }, + ">; getFilters: () => Promise<", "Filter", "[]>; getInspectorAdapters: () => ", { @@ -5335,7 +6039,9 @@ "section": "def-public.ContainerOutput", "text": "ContainerOutput" }, - ">; }" + ">; updateOutput: (outputChanges: Partial<", + "VisualizeOutput", + ">) => void; }" ], "path": "src/plugins/visualizations/public/index.ts", "deprecated": false, @@ -5442,7 +6148,13 @@ "text": "ErrorEmbeddable" }, " | ", - "VisualizeEmbeddable", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeEmbeddable", + "text": "VisualizeEmbeddable" + }, " | ", "DisabledLabEmbeddable", " | undefined>; isEditable: () => Promise; getDisplayName: () => string; createFromSavedObject: (savedObjectId: string, input: Partial<", @@ -5486,7 +6198,13 @@ "text": "ErrorEmbeddable" }, " | ", - "VisualizeEmbeddable", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeEmbeddable", + "text": "VisualizeEmbeddable" + }, " | ", "DisabledLabEmbeddable", ">; readonly savedObjectMetaData: ", @@ -5505,7 +6223,7 @@ "section": "def-public.OnSaveProps", "text": "OnSaveProps" }, - ") => Promise; }" + ") => Promise; }" ], "path": "src/plugins/visualizations/public/index.ts", "deprecated": false, diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index b3f63f26dfdeb..1a28d8bd40a47 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github description: API docs for the visualizations plugin -date: 2022-08-16 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 380 | 12 | 356 | 14 | +| 414 | 12 | 386 | 15 | ## Client diff --git a/dev_docs/contributing/standards.mdx b/dev_docs/contributing/standards.mdx index 1bb54ada1509c..aba29e5fab2f2 100644 --- a/dev_docs/contributing/standards.mdx +++ b/dev_docs/contributing/standards.mdx @@ -15,6 +15,49 @@ We expect all developers to read and abide by our overarching . The majority of these items are linted against but some are not. +## Adding dependencies + +Looking for a dependency that isn't already available in Kibana? There are a few things to keep in mind before adding a new dependency. + +First, be sure you have read and are familiar with our . In particular, **Be wary of dependencies** +and **Prefer one way to do things** provide an overview of how we approach this question. + +In general, we have a bias toward **not** adding new dependencies unless there is a compelling reason to do so, as we want to +minimize Kibana's overall complexity. + +Should you find yourself evaluating a new dependency, here are some specific things to ask yourself: + +1. **Is there already another dependency that offers similar functionality?** If so, adding a new dependency may not be necessary. +Prefer one way to do things and use what's already there, unless there is an important reason not to do so. +2. **Does this dependency appear to be well-maintained?** A dependency that hasn't been updated in years is usually more of a +liability than an asset. Make sure the depedency has recent activity, that bugs and security vulnerabilities appear to be addressed +in a timely manner, and that there is active participation from the maintainers and community. +3. **How large is the dependency?** For client-side plugins, heavy dependencies can have a real impact on user experience, +especially if they are included in the initial page bundle and not loaded asynchronously. In some cases it might make more sense +to roll your own rather than include a bloated depedency, especially if you are only using a single piece of functionality. +4. **Does this dependency have a license that's compatible with Kibana's?** Most common open source licenses such as BSD, MIT, +and Apache 2.0/1.1 are okay to use with Kibana. Others may not be, or may require special attribution. +5. **Will this dependency need to be prebuilt?** Due to our build process, native module dependencies should include at least a prebuild +step so at install time it simply downloads instead of building from source. This allows us to optimize bootstrap times. +6. **Am I committed to maintaining this dependency?** Once you add a dependency to the `package.json`, someone else isn't going to +keep it updated for you. That means you will be responsible for updating it regularly, keeping an eye out for security vulnerabilities, +and dealing with any breaking changes that may arise during an upgrade. We recommend relying on the renovate bot to help keep the +dependency updated; be sure to mark your ownership of the package in the +[`renovate.json`](https://github.com/elastic/kibana/blob/main/renovate.json`) file. + +If you have any questions about whether adding a dependency is appropriate, feel free to reach out to one of the following teams +on Github: + +- **@elastic/kibana-tech-leads** +- **@elastic/kibana-core** +- **@elastic/kibana-operations** +- **@elastic/kibana-security** + + + If you are unsure of which licenses are okay to use, refer to the + [Permitted Open Source Licenses list](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#permitted-licenses-list). + + ## RESTful HTTP APIs ### Terminology diff --git a/dev_docs/key_concepts/embeddables.mdx b/dev_docs/key_concepts/embeddables.mdx index f1a2bea5b9b12..e42233a7f3f26 100644 --- a/dev_docs/key_concepts/embeddables.mdx +++ b/dev_docs/key_concepts/embeddables.mdx @@ -14,6 +14,7 @@ If you are planning to integrate with the plugin, please get in touch with the A ## Capabilities - Framework-agnostic API. - Out-of-the-box React support. +- Integration with Redux. - Integration with the [UI Actions](https://github.com/elastic/kibana/tree/HEAD/src/plugins/ui_actions) plugin. - Hierarchical structure to enclose multiple widgets. - Error handling. diff --git a/dev_docs/operations/packages_idm.mdx b/dev_docs/operations/packages_idm.mdx index 62fe1a76c69f2..082af6605b092 100644 --- a/dev_docs/operations/packages_idm.mdx +++ b/dev_docs/operations/packages_idm.mdx @@ -11,13 +11,13 @@ tags: ['kibana', 'dev', 'contributor', 'operations', 'idm', 'packages'] The size of the Kibana repository has surpassed almost all other Typescript projects on Github, and the Javascript tooling ecosystem is inadequate. AppEx Operations team has done a lot of work over the years to close these gaps and keep up with our codebase's growth. Still, significant steps are necessary to provide a more efficient development experience. The AppEx Operations team is leading an effort to migrate to Bazel, which among other things, will provide remote caching and incremental builds. This initiative should drastically improve the productivity of Kibana contributors by minimizing what needs to be built, both locally and in CI, and providing faster and more thorough feedback. - This document represents the target of the IDM project and not the currently implemented features. See [What works now?][status] for information about current implementation status. + This document represents the target of the IDM project and not the currently implemented features. See [What works now?][status] for information about the current implementation status. ## Goals - Use packages as a core unit of code used throughout the repository -- Packages have well defined boundaries, a single responsibility, and are easily reusable and shareable across the repository when desired +- Packages have well-defined boundaries, a single responsibility, and are easily reusable and shareable across the repository when desired - Support organizing the repository by domain - Allow developers and CI to benefit from a remote cache and incremental builds for all development/validation/build tasks @@ -26,13 +26,13 @@ The size of the Kibana repository has surpassed almost all other Typescript proj These are some of the terms we are using to describe parts of this initiative: Build Tasks/Tasks -: We refer to any task/command that is executed as part of developement or CI as a "build task" or just "task" +: We refer to any task/command that is executed as part of development or CI as a "build task" or just "task". Package : Packages can be installed from NPM, or implemented in the repository. Local packages are structured in a specific way detailed in the [Package Structure](#package-structure) section. Incremental tasks -: The ability to execute the minimal set of build tasks necessary by inspecting the files which have changed and utilizing local+remote caches +: The ability to execute the minimal set of build tasks necessary by inspecting the files which have changed and utilizing local+remote caches. ## Package Structure @@ -41,52 +41,52 @@ Every package has: - a type, see [Package Types](#package-types) - dependencies on other packages in the repo or from NPM declared in their `kibana.jsonc` file and updated automatically - configuration files like `BUILD.bazel`, `jest.config.js`, `package.json`, etc. which are automatically generated when necessary from the `kibana.jsonc` file. - - a single interface. When you import a package you get it's one and only interface. Packages don't have sub-imports, or sub-modules. + - a single interface. When you import a package you get its one (and only) interface. Packages don't have sub-imports or sub-modules. - the ability to include jest tests alongside the code ## Package Types - -Every package is of one of the following types. Using package types allows us to have many different packages and pre-defined build tasks, restrictions, and unique config for each package type. There is currently a proposal to add a new `test-helpers` package type, and we expect more package types to be defined in the future. +Package types allow us to have many different packages, pre-defined build tasks, restrictions, and unique configurations for each package type. Every package is one of the following types: `shared-common` : These packages can be imported from all other packages. `shared-browser` -: These packages can be imported from `shared-browser` and `plugin-browser` packages. Storybooks may be included in package of type `shared-browser`. +: These packages can be imported from `shared-browser` and `plugin-browser` packages. `shared-browser` packages may include Storybooks. `shared-server` : These packages can be imported from `shared-server` and `plugin-server` packages. `shared-scss` -: These packages can be imported by `shared-browser` and `plugin-browser` packages. Instead of an `index.ts` file these pacakges have an `index.scss` file which will be exposed to consumers of this package. +: These packages can be imported by `shared-browser` and `plugin-browser` packages, and expose an `index.scss` file to consumers instead of an `index.ts` file. `plugin-browser` -: These packages expose types to other packages via a root `types.ts` file, `import type` statements must be used when importing. Module IDs must end with `-plugin-browser`. +: These packages expose types to other packages via a root `types.ts` file. Module IDs must end with `-plugin-browser`. Consumers must use `import type` statements. `plugin-server` -: These packages expose types to other packages via a root `types.ts` file, `import type` statements must be used when importing. Module IDs must end with `-plugin-server`. +: These packages expose types to other packages via a root `types.ts` file. Module IDs must end with `-plugin-server`. Consumers must use `import type` statements. `functional-test` -: These packages can not be imported by other packages and expose one or more functional testing configurations, including API integration tests. Having this separate means that iterating on functional tests will not need to rebuild the application and updating the application will usually not rebuild the tests. - +: These packages expose one or more functional testing configurations, including API integration tests, and can not be imported by other packages. Separating functional and integration tests allows us to iterate on tests without rebuilding the application. Similarly, iterating and updating the application should mostly mean the tests don't need to rebuild. +There is currently a proposal to add a new `test-helpers` package type, and we expect more package types to be defined in the future if and when the need arises. + ## Phases -We're planning to implement the full package system described in phases. Currently, those phases look like this: +We're planning to implement the full package system in phases. Currently, those phases look like this: ### Phase 1: Ground preparation **status:** ✅ complete -This phase is about identifying issues that would prevent a migration for teams in order to provide adequate time for them before they have the need to migrate. +This phase is about identifying issues that would prevent a migration for teams to provide adequate time for them before they need to migrate. - Migrate all plugins to use module IDs - - Find instances of ESLint being disabled and illegal cross-boundary imports are used; create issues for teams to address + - Find instances where ESLint is disabled and illegal cross-boundary imports are used; create issues for teams to address - Prevent naked eslint-disable - Prevent disabling specific ESLint rules - Windows development is not supported - - Rewrite @kbn/pm using native Node.js to remove its build step. Anything outside of bootstrap like clean and reset commands will move to different packages. - - Document how to break up packages into smaller pieces + - Rewrite `@kbn/pm` using native Node.js to remove its build step. Anything outside of bootstrap, like clean and reset commands, will move to different packages. + - Document how to break up packages into smaller units of code ### Phase 2: Legacy packages migration @@ -94,9 +94,9 @@ This phase is about identifying issues that would prevent a migration for teams This phase is about migrating the existing legacy packages to one of the [package types](#package-types). - - Add kibana.json files to existing packages - - Auto generating configuration files based on the `kibana.jsonc` manifest - - Discover dependencies used in packages automatically + - Add `kibana.json` files to existing packages + - Auto-generate configuration files based on `kibana.jsonc` manifests + - Automate package dependency discovery ### Phase 3: Double down on DX @@ -116,13 +116,13 @@ This phase is all about supporting the creation of plugin-browser and plugin-ser - Extracting Webpack config from @kbn/optimizer to work on a single bundle inside Bazel - Update plugin discovery to find and differentiate between legacy plugins and plugin-browser/server packages - ESLint rules to validate imports into and out of plugin-browser and plugin-server packages - - Finish the migration of core to packages and reflect with the core team (and possibly the Shared UX team) around what we should recommend for plugin authors before we start to migrate legacy plugins to the package system + - Finish the migration of core to packages and reflect with the core team (and possibly the Shared UX team) on what we should recommend for plugin authors before we start to migrate legacy plugins to the package system - Documentation, documentation, documentation - How do 3rd party plugins migrate to the new system? ### Phase 5: Legacy plugins migration -This phase is all about having the solution teams migrating their legacy plugins into packages. +This phase is all about having the solution teams migrate their legacy plugins into packages. - Identify the order of plugins that can be migrated - Identify and communicate what needs to be done by teams @@ -137,40 +137,40 @@ This phase is about finalizing the rough edges and making sure every piece of co - Extend the package development tooling to support 3rd party package development and allow packages to participate in the benefits of Bazel within the `plugins` directory. - Ability for 3rd party packages to require specific versions of specific packages from NPM - Automatically build the components that need changes - - Build package artifacts that can be installed in Kibana distributables + - Build package artifacts that can be installed in a Kibana distributable ## FAQ ### Is it time for me to start creating packages? -Probably not. The Shared UX and Core teams are currently our Guinea Pig teams and they're experiencing the pain of living on the bleeding edge. If you want to create a single package you are welcome to, but for now it's probably best that you wait until Operations reached out to your team. +Probably not. The Shared UX and Core teams are currently our "Guinea Pig" teams and they're experiencing the pain of living on the bleeding edge. If you want to create a single package you are welcome to, but for now, it's probably best that you wait until Operations reached out to your team. ### How do circular dependencies work? -By breaking the repository into packages we not be able to support cross-package circular dependency. +By breaking the repository into packages we can't support cross-package circular dependencies. -Imagine trying to build the types for `@kbn/a`, which depend on the types for `@kbn/b`. If `@kbn/b` also depends on the types for `@kbn/a` there is no way to build the types for eather package because they form a circular dependency. +For example, imagine trying to build the types for `@kbn/a` that depend on the types for `@kbn/b`. If `@kbn/b` also depends on the types for `@kbn/a` there's a circular dependency meaning there isn't a way to build the types for either. -If you cause a circular dependency in the task graph Bazel will produce a pretty great error message explaining where the cycle is. +If you cause a circular dependency in the task graph, Bazel will produce a pretty great error message explaining where the cycle is. -So far, the solution to resolving circular dependencies has always been to break out some component which is causing the circular dependency into a separate package. Packages are light weight, and are very easy to create ([work in progress][status]) so please feel comfortable creating more packages. +The solution to resolving a circular dependency has, thus far, been to break out the component causing it, into a separate package. Packages are lightweight and are very easy to create ([work in progress][status]) so please feel comfortable creating more packages as you need to. ### How do we name packages? There are a few package naming rules: - all packages must use the `@kbn/` namespace - - `plugin-browser` packages must end with `-plugin-browser` - - `plugin-server` packages must end with `-plugin-server` - - be considerate of the fact that we are operating in a global namespace and avoid overly generic names + - `plugin-browser`-type packages must end with `-plugin-browser` + - `plugin-server- type packages must end with `-plugin-server` + - considering that we operate in a global namespace, avoid overly generic names -Other than these rules, it's up to you what the best name for your package is. +Other than these rules, it's up to you and your team to decide on an appropriate name for your package. - Keep the single responsibility principle in mind, if there isn't a clear name for your package it might mean that it includes too many things and should be split into multiple smaller packages with explicit purposes. + Keep the single responsibility principle in mind. A good indication that a package contains too much is that naming it isn’t easy. In such cases, consider splitting it into multiple, smaller packages with their specific purpose. -The shared-ux team makes a lot of packages containing a single component which is widely shared and provides a lot of helpers and types for other packages to consume, the shared-ux team has used the following naming scheme: +The shared-ux team makes a lot of packages, each containing a single, widely shared component along with helpers and types, for other packages to consume. The shared-ux team has used the following naming scheme: ``` /{domain}/{componentName} @@ -191,15 +191,15 @@ The `@kbn/{team}-{domain}-{component}(-{type})?` style naming scheme is also fol ### Where do I put my package? -The only rule the package system enforces is that packages can't live inside of other packages. Additionally, for licensing purposes it's probably best to keep SSPL licensed code in the `packages` or `src` directories and Elastic licensed code in the `x-pack` directory. +The only rule the package system enforces is that packages can't live inside of other packages. Additionally, for licensing purposes, it's probably best to keep SSPL licensed code in the `packages` or `src` directories and Elastic licensed code in the `x-pack` directory. -Otherise, you can put your packages wherever you like. It's probably best that you don't put them in the current `packages` directory as it's huge and only getting bigger with time. +Otherwise, you can put your packages wherever you like. It's probably best that you don't put them in the current `packages` directory as it's huge and only getting bigger with time. To define a new directory where packages will live you will need to edit the [`BAZEL_PACKAGE_DIRS`][pkgDirs] const. This list points to all the directories where packages can live in the repository and includes the current list of locations where packages are being created. ### What works now? -Today we have a basic package generator that produces legacy package definitions. We're done laying the groundwork now and have both the Core and Shared UX teams playing guinea pig. You can use the legacy package generator with `node scripts/generate package` and create a package, but it's not the right time for more teams to start migrating large portions of their code to packages. +Today we have a simplistic package generator that produces legacy package definitions. We've finished laying the groundwork and have both the Core and Shared UX teams experimenting with it. You can use the legacy package generator with `node scripts/generate package` and create a package, however, we don’t recommend other teams to start migrating large portions of their code to packages just yet. We're now entering Phase 2 of the plan, more details about the phases of our plan can be found [above](#phases) diff --git a/docs/canvas/canvas-tutorial.asciidoc b/docs/canvas/canvas-tutorial.asciidoc index 389cac89cde82..73d808a183920 100644 --- a/docs/canvas/canvas-tutorial.asciidoc +++ b/docs/canvas/canvas-tutorial.asciidoc @@ -9,9 +9,11 @@ To familiarize yourself with *Canvas*, add the Sample eCommerce orders data, the To create a workpad of the eCommerce store data, add the data set, then create the workpad. -. Go to the {kib} *Home* page, then click *Try our sample data*. +. On the home page, click *Try sample data*. -. On the *Sample eCommerce orders data* card, click *Add data*. +. Click *Other sample data sets*. + +. On the *Sample eCommerce orders* card, click *Add data*. . Open the main menu, then click *Canvas*. diff --git a/docs/concepts/data-views.asciidoc b/docs/concepts/data-views.asciidoc index 9e2015fc730a4..8726b3a55cbd0 100644 --- a/docs/concepts/data-views.asciidoc +++ b/docs/concepts/data-views.asciidoc @@ -65,7 +65,7 @@ based on different timestamps. . To specify your own {data-source} name, click *Show advanced settings*, then enter the name in the *Custom {data-source} ID* field. For example, enter your {es} index alias name. -. Click *Create {data-source}*. +. Click *Save {data-source} to {kib}*. + [[reload-fields]] {kib} is now configured to use your {es} data. When a new field is added to an index, the {data-source} field list is updated @@ -149,4 +149,4 @@ WARNING: Deleting a {data-source} breaks all visualizations, saved searches, and . Open the main menu, then click *Stack Management > Data Views*. . Find the {data-source} that you want to delete, and then -click (image:management/index-patterns/images/delete.png[Delete icon]) in the *Actions* column. +click image:management/index-patterns/images/delete.png[Delete icon] in the *Actions* column. diff --git a/docs/developer/getting-started/monorepo-packages.asciidoc b/docs/developer/getting-started/monorepo-packages.asciidoc index b6524c6007b2e..a9dc912ab58e4 100644 --- a/docs/developer/getting-started/monorepo-packages.asciidoc +++ b/docs/developer/getting-started/monorepo-packages.asciidoc @@ -41,8 +41,6 @@ yarn kbn watch [discrete] === List of Already Migrated Packages to Bazel -- @elastic/eslint-config-kibana -- @elastic/safer-lodash-set - @kbn/ace - @kbn/analytics - @kbn/apm-config-loader @@ -57,6 +55,7 @@ yarn kbn watch - @kbn/docs-utils - @kbn/es - @kbn/es-archiver +- @kbn/eslint-config-kibana - @kbn/eslint-plugin-eslint - @kbn/expect - @kbn/i18n @@ -68,6 +67,7 @@ yarn kbn watch - @kbn/optimizer - @kbn/plugin-helpers - @kbn/rule-data-utils +- @kbn/safer-lodash-set - @kbn/securitysolution-autocomplete - @kbn/securitysolution-es-utils - @kbn/securitysolution-hook-utils diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 64077b2ecc106..00f0bc517f5a5 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -259,10 +259,6 @@ oss plugins. generating deep links to other apps using locators, and creating short URLs. -|{kib-repo}blob/{branch}/src/plugins/shared_ux/README.md[sharedUX] -|Our mission is to make consistency in our user experience a product. - - |{kib-repo}blob/{branch}/src/plugins/telemetry/README.md[telemetry] |Telemetry allows Kibana features to have usage tracked in the wild. The general term "telemetry" refers to multiple things: diff --git a/docs/discover/document-explorer.asciidoc b/docs/discover/document-explorer.asciidoc index 665d668a41ee7..32811cfbe7728 100644 --- a/docs/discover/document-explorer.asciidoc +++ b/docs/discover/document-explorer.asciidoc @@ -27,13 +27,13 @@ data-type="inline" Use drag and drop to organize the columns and improve the view of the data. -To reorder columns, do one of the following: +* To move a single column, click its header. In the dropdown menu, +click *Move left* or *Move right*. -* Click *Columns*. In the pop-up, select the column you want to move and drag it to the new location. +* To move multiple columns, click *Columns*. +In the pop-up, drag the column names to their new order. -* Click the header of the column you want to move. In the dropdown menu, click *Move left* or *Move right*. - -To resize a column, drag the right edge of the column header until the column is the width that you want. +* To resize a column, drag the right edge of the column header until the column is the width that you want. Column widths are stored with a saved search. When you visualize saved searches on dashboards, the saved search appears the same as in **Discover**. @@ -104,7 +104,7 @@ You can view the document in two ways. The **Table** view displays the document The **JSON** (JavaScript Object Notation) view allows you to look at how {es} returns the document. + [role="screenshot"] -image::images/document-explorer-expand.png[Expanded view of the document table] +image::images/document-table-expanded.png[Expanded view of the document table] + . In the *Table* view, scan through the fields and their values, or search for a field by name. @@ -152,4 +152,4 @@ By default, the document table displays 100 rows per page. To change this number click *Rows per page*. [role="screenshot"] -image::images/document-table-rows-per-page.png["Menu with options for setting the number of rows in the document table", width=50%] +image::images/document-table-rows-per-page.png["Menu with options for setting the number of rows in the document table"] diff --git a/docs/discover/field-statistics.asciidoc b/docs/discover/field-statistics.asciidoc index 52f78f3376cda..6c5b5a6767a50 100644 --- a/docs/discover/field-statistics.asciidoc +++ b/docs/discover/field-statistics.asciidoc @@ -16,7 +16,7 @@ the <>, or you can use your own d . Open the main menu, and click *Discover*. -. Expand the {data-source} dropdown, and select *kibana_sample_data_logs*. +. Expand the {data-source} dropdown, and select *Kibana Sample Data Logs*. . If you don’t see any results, expand the time range, for example, to *Last 7 days*. diff --git a/docs/discover/images/customer.png b/docs/discover/images/customer.png index 2ab177eba28bf..c60c98b25e54d 100644 Binary files a/docs/discover/images/customer.png and b/docs/discover/images/customer.png differ diff --git a/docs/discover/images/discover-context.png b/docs/discover/images/discover-context.png index b625a18b35aa2..35954fa7a2b51 100644 Binary files a/docs/discover/images/discover-context.png and b/docs/discover/images/discover-context.png differ diff --git a/docs/discover/images/discover-data-view.png b/docs/discover/images/discover-data-view.png index c73af3db24140..50b1866ab7a68 100644 Binary files a/docs/discover/images/discover-data-view.png and b/docs/discover/images/discover-data-view.png differ diff --git a/docs/discover/images/discover-from-visualize.png b/docs/discover/images/discover-from-visualize.png index 74307bcd46a2c..2a3ba610299b6 100644 Binary files a/docs/discover/images/discover-from-visualize.png and b/docs/discover/images/discover-from-visualize.png differ diff --git a/docs/discover/images/discover-search-for-relevance.png b/docs/discover/images/discover-search-for-relevance.png index d9d5834c9e382..e710cab0ddf2f 100644 Binary files a/docs/discover/images/discover-search-for-relevance.png and b/docs/discover/images/discover-search-for-relevance.png differ diff --git a/docs/discover/images/discover-sidebar-available-fields.png b/docs/discover/images/discover-sidebar-available-fields.png index e330036524ae7..363f3f7141086 100644 Binary files a/docs/discover/images/discover-sidebar-available-fields.png and b/docs/discover/images/discover-sidebar-available-fields.png differ diff --git a/docs/discover/images/discover.png b/docs/discover/images/discover.png index 818b9ed5d2599..1a2d839717f76 100644 Binary files a/docs/discover/images/discover.png and b/docs/discover/images/discover.png differ diff --git a/docs/discover/images/document-table-expanded.png b/docs/discover/images/document-table-expanded.png index 0248c31f894e0..06b244268c1d7 100644 Binary files a/docs/discover/images/document-table-expanded.png and b/docs/discover/images/document-table-expanded.png differ diff --git a/docs/discover/images/document-table-rows-per-page.png b/docs/discover/images/document-table-rows-per-page.png index 21643903e4021..54ab8c359239a 100644 Binary files a/docs/discover/images/document-table-rows-per-page.png and b/docs/discover/images/document-table-rows-per-page.png differ diff --git a/docs/discover/images/document-table.png b/docs/discover/images/document-table.png index 388f3c4344a09..6cb47390fd584 100644 Binary files a/docs/discover/images/document-table.png and b/docs/discover/images/document-table.png differ diff --git a/docs/discover/images/hello-field.png b/docs/discover/images/hello-field.png index 8dd38a9f94209..40527e90fbb64 100644 Binary files a/docs/discover/images/hello-field.png and b/docs/discover/images/hello-field.png differ diff --git a/docs/discover/search-for-relevance.asciidoc b/docs/discover/search-for-relevance.asciidoc index df581634877f1..c6f092edd0015 100644 --- a/docs/discover/search-for-relevance.asciidoc +++ b/docs/discover/search-for-relevance.asciidoc @@ -10,7 +10,7 @@ the <>, or you can use your ow . In *Discover*, open the {data-source} dropdown, and select the data that you want to work with. + -For the sample flights data, set the {data-source} to *kibana_sample_data_flights*. +For the sample flights data, set the {data-source} to *Kibana Sample Data Flights*. . Run your search. For the sample data, try: + @@ -32,4 +32,4 @@ image::images/field-sorting-popover.png["Field sorting popover", width=60%] Your table now sorts documents from most to least relevant. + [role="screenshot"] -image::images/discover-search-for-relevance.png["Documents are sorted from most relevant to least relevant.", width=75%] +image::images/discover-search-for-relevance.png["Documents are sorted from most relevant to least relevant."] diff --git a/docs/getting-started/images/addData_sampleDataCards_7.15.0.png b/docs/getting-started/images/addData_sampleDataCards_7.15.0.png deleted file mode 100644 index 27e10b98b9670..0000000000000 Binary files a/docs/getting-started/images/addData_sampleDataCards_7.15.0.png and /dev/null differ diff --git a/docs/getting-started/images/addData_sampleDataCards_8.4.0.png b/docs/getting-started/images/addData_sampleDataCards_8.4.0.png new file mode 100644 index 0000000000000..49a83dbbdc10b Binary files /dev/null and b/docs/getting-started/images/addData_sampleDataCards_8.4.0.png differ diff --git a/docs/getting-started/images/addFilterOptions_dashboard_8.4.0.png b/docs/getting-started/images/addFilterOptions_dashboard_8.4.0.png new file mode 100644 index 0000000000000..eb16edb2b0764 Binary files /dev/null and b/docs/getting-started/images/addFilterOptions_dashboard_8.4.0.png differ diff --git a/docs/getting-started/images/addFilter_dashboard_8.4.0.png b/docs/getting-started/images/addFilter_dashboard_8.4.0.png new file mode 100644 index 0000000000000..eeec26daad89d Binary files /dev/null and b/docs/getting-started/images/addFilter_dashboard_8.4.0.png differ diff --git a/docs/getting-started/images/availableFields_discover_8.4.0.png b/docs/getting-started/images/availableFields_discover_8.4.0.png new file mode 100644 index 0000000000000..ba3b9ecaeb4ac Binary files /dev/null and b/docs/getting-started/images/availableFields_discover_8.4.0.png differ diff --git a/docs/getting-started/images/dashboard_ecommerceRevenueDashboard_7.15.0.png b/docs/getting-started/images/dashboard_ecommerceRevenueDashboard_7.15.0.png index 5b62832b1d093..7fbc0a9bad411 100644 Binary files a/docs/getting-started/images/dashboard_ecommerceRevenueDashboard_7.15.0.png and b/docs/getting-started/images/dashboard_ecommerceRevenueDashboard_7.15.0.png differ diff --git a/docs/getting-started/images/dashboard_sampleDataAddFilter_8.4.0.png b/docs/getting-started/images/dashboard_sampleDataAddFilter_8.4.0.png new file mode 100644 index 0000000000000..4c253d3fc3ac5 Binary files /dev/null and b/docs/getting-started/images/dashboard_sampleDataAddFilter_8.4.0.png differ diff --git a/docs/getting-started/images/dashboard_sampleDataFilter_7.15.0.png b/docs/getting-started/images/dashboard_sampleDataFilter_7.15.0.png deleted file mode 100644 index f1f46ab42371a..0000000000000 Binary files a/docs/getting-started/images/dashboard_sampleDataFilter_7.15.0.png and /dev/null differ diff --git a/docs/getting-started/images/ecommerceTreemap_lens_8.4.0.png b/docs/getting-started/images/ecommerceTreemap_lens_8.4.0.png new file mode 100644 index 0000000000000..d933ce93de9d1 Binary files /dev/null and b/docs/getting-started/images/ecommerceTreemap_lens_8.4.0.png differ diff --git a/docs/getting-started/images/kql_discover_8.4.0.png b/docs/getting-started/images/kql_discover_8.4.0.png new file mode 100644 index 0000000000000..cc0398049013a Binary files /dev/null and b/docs/getting-started/images/kql_discover_8.4.0.png differ diff --git a/docs/getting-started/images/sampleDataFilter_dashboard_8.4.0.png b/docs/getting-started/images/sampleDataFilter_dashboard_8.4.0.png new file mode 100644 index 0000000000000..7b5af0ad39395 Binary files /dev/null and b/docs/getting-started/images/sampleDataFilter_dashboard_8.4.0.png differ diff --git a/docs/getting-started/images/timeFilter_discover_8.4.0.png b/docs/getting-started/images/timeFilter_discover_8.4.0.png new file mode 100644 index 0000000000000..73f13ef2b1d9c Binary files /dev/null and b/docs/getting-started/images/timeFilter_discover_8.4.0.png differ diff --git a/docs/getting-started/images/tutorial-discover-2.png b/docs/getting-started/images/tutorial-discover-2.png deleted file mode 100644 index cf217562c37fd..0000000000000 Binary files a/docs/getting-started/images/tutorial-discover-2.png and /dev/null differ diff --git a/docs/getting-started/images/tutorial-discover-3.png b/docs/getting-started/images/tutorial-discover-3.png deleted file mode 100644 index 79cf94058bb76..0000000000000 Binary files a/docs/getting-started/images/tutorial-discover-3.png and /dev/null differ diff --git a/docs/getting-started/images/tutorial-discover-4.png b/docs/getting-started/images/tutorial-discover-4.png deleted file mode 100644 index 584221e8cfd04..0000000000000 Binary files a/docs/getting-started/images/tutorial-discover-4.png and /dev/null differ diff --git a/docs/getting-started/images/tutorial-visualization-dropdown.png b/docs/getting-started/images/tutorial-visualization-dropdown.png deleted file mode 100644 index a069af95ed14a..0000000000000 Binary files a/docs/getting-started/images/tutorial-visualization-dropdown.png and /dev/null differ diff --git a/docs/getting-started/images/tutorial-visualization-treemap.png b/docs/getting-started/images/tutorial-visualization-treemap.png deleted file mode 100644 index c6e8db133cb44..0000000000000 Binary files a/docs/getting-started/images/tutorial-visualization-treemap.png and /dev/null differ diff --git a/docs/getting-started/images/visualizationTypeDropdown_lens_8.4.0.png b/docs/getting-started/images/visualizationTypeDropdown_lens_8.4.0.png new file mode 100644 index 0000000000000..731327997c59b Binary files /dev/null and b/docs/getting-started/images/visualizationTypeDropdown_lens_8.4.0.png differ diff --git a/docs/getting-started/quick-start-guide.asciidoc b/docs/getting-started/quick-start-guide.asciidoc index 2667729f4b854..bc98fbf5af737 100644 --- a/docs/getting-started/quick-start-guide.asciidoc +++ b/docs/getting-started/quick-start-guide.asciidoc @@ -1,13 +1,13 @@ [[get-started]] == Quick start -To quickly get up and running with {kib}, set up on Cloud, then add a sample data set that you can explore and analyze. +To quickly get up and running with {kib}, set up on Cloud, then add a sample data set that you can explore and visualize. -When you've finished, you'll know how to: +When you're done, you'll know how to: * <> -* <> +* <> [float] === Required privileges @@ -26,12 +26,14 @@ include::{docs-root}/shared/cloud/ess-getting-started.asciidoc[] Sample data sets come with sample visualizations, dashboards, and more to help you explore {kib} before you ingest or add your own data. -. On the home page, click *Try our sample data*. +. On the home page, click *Try sample data*. + +. Click *Other sample data sets*. . On the *Sample eCommerce orders* card, click *Add data*. + [role="screenshot"] -image::images/addData_sampleDataCards_7.15.0.png[Add data UI for the sample data sets] +image::images/addData_sampleDataCards_8.4.0.png[Add data UI for the sample data sets] [float] [[explore-the-data]] @@ -44,7 +46,7 @@ image::images/addData_sampleDataCards_7.15.0.png[Add data UI for the sample data . Change the <> to *Last 7 days*. + [role="screenshot"] -image::images/tutorial-discover-2.png[Time filter menu with Last 7 days filter configured] +image::images/timeFilter_discover_8.4.0.png[Time filter menu with Last 7 days filter configured] . To view the sales orders for women's clothing that are $60 or more, use the <> search field: + @@ -52,18 +54,18 @@ image::images/tutorial-discover-2.png[Time filter menu with Last 7 days filter c products.taxless_price >= 60 and category : Women's Clothing + [role="screenshot"] -image::images/tutorial-discover-4.png[Discover tables that displays only the orders for women's clothing that are $60 or more] +image::images/kql_discover_8.4.0.png[Discover tables that displays only the orders for women's clothing that are $60 or more] . To view only the product categories that contain sales orders, hover over the *category* field, then click *+*. + [role="screenshot"] -image::images/tutorial-discover-3.png[Discover table that displays only the product categories that contain orders] +image::images/availableFields_discover_8.4.0.png[Discover table that displays only the product categories that contain orders] [float] [[view-and-analyze-the-data]] -== View and analyze the data +== Visualize the data -A dashboard is a collection of panels that you can use to view and analyze the data. Panels contain visualizations, interactive controls, text, and more. +A dashboard is a collection of panels that you can use to visualize the data. Panels contain visualizations, interactive controls, text, and more. . Open the main menu, then click *Dashboard*. @@ -76,7 +78,7 @@ image::images/dashboard_ecommerceRevenueDashboard_7.15.0.png[The [eCommerce] Rev [[create-a-visualization]] === Create a visualization panel -Create a treemap panel that shows the top sales regions and manufacturers, then add the panel to the dashboard. +Create a treemap visualization panel that shows the top sales regions and manufacturers, then add the panel to the dashboard. . In the toolbar, click *Edit*. @@ -85,7 +87,7 @@ Create a treemap panel that shows the top sales regions and manufacturers, then . In the drag-and-drop visualization editor, open the *Visualization type* dropdown, then select *Treemap*. + [role="screenshot"] -image::getting-started/images/tutorial-visualization-dropdown.png[Chart type menu with Treemap selected] +image::getting-started/images/visualizationTypeDropdown_lens_8.4.0.png[Chart type menu with Treemap selected] . From the *Available fields* list, drag the following fields to the workspace: @@ -94,7 +96,7 @@ image::getting-started/images/tutorial-visualization-dropdown.png[Chart type men * *manufacturer.keyword* + [role="screenshot"] -image::getting-started/images/tutorial-visualization-treemap.png[Treemap that displays Top values of geoip.city_name and Top values or manufacturer.keyword fields] +image::getting-started/images/ecommerceTreemap_lens_8.4.0.png[Treemap that displays Top values of geoip.city_name and Top values or manufacturer.keyword fields] . Click *Save and return*. + @@ -113,26 +115,32 @@ You can interact with the dashboard data using controls that allow you to apply . Click *Apply changes*. + [role="screenshot"] -image::images/dashboard_sampleDataFilter_7.15.0.png[The [eCommerce] Revenue Dashboard that shows only the women's clothing data from the Gnomehouse manufacturer] +image::images/sampleDataFilter_dashboard_8.4.0.png[The [eCommerce] Revenue Dashboard that shows only the women's clothing data from the Gnomehouse manufacturer] [float] [[filter-and-query-the-data]] === Filter the data -To view a subset of the data, you can apply filters to the dashboard panels. Apply a filter to view the women's clothing data generated on Wednesday from the Gnomehouse manufacturer. +To view a subset of the data, you can apply filters to the dashboard data. Apply a filter to view the women's clothing data generated on Wednesday from the Gnomehouse manufacturer. . Click *Add filter*. ++ +[role="screenshot"] +image::images/addFilter_dashboard_8.4.0.png[The Add filter action that applies dashboard-level filters] . From the *Field* dropdown, select *day_of_week*. . From the *Operator* dropdown, select *is*. . From the *Value* dropdown, select *Wednesday*. ++ +[role="screenshot"] +image::images/addFilterOptions_dashboard_8.4.0.png[The Add filter options configured to display only the women's clothing data generated on Wednesday from the Gnomehouse manufacturer] -. Click *Save*. +. Click *Add filter*. + [role="screenshot"] -image::images/dashboard_sampleDataAddFilter_7.15.0.png[The [eCommerce] Revenue Dashboard that shows only the women's clothing data generated on Wednesday from the Gnomehouse manufacturer] +image::images/dashboard_sampleDataAddFilter_8.4.0.png[The [eCommerce] Revenue Dashboard that shows only the women's clothing data generated on Wednesday from the Gnomehouse manufacturer] [float] [[quick-start-whats-next]] @@ -142,6 +150,6 @@ image::images/dashboard_sampleDataAddFilter_7.15.0.png[The [eCommerce] Revenue D *Explore your own data in Discover.* Ready to learn more about exploring your data in *Discover*? Go to <>. -*Create a dashboard with your own data.* Ready to learn more about analyzing your data in *Dashboard*? Go to <>. +*Create a dashboard with your own data.* Ready to learn more about visualizing your data on a *Dashboard*? Go to <>. *Try out the {ml-features}.* Ready to analyze the sample data sets and generate models for its patterns of behavior? Go to {ml-docs}/ml-getting-started.html[Getting started with {ml}]. diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc index c0fdb537aed73..7a1eaae676906 100644 --- a/docs/management/advanced-options.asciidoc +++ b/docs/management/advanced-options.asciidoc @@ -286,8 +286,8 @@ in the current data view is used. The columns that appear by default on the *Discover* page. The default is `_source`. -[[discover-samplesize]]`discover:sampleSize`:: -The number of rows to show in the *Discover* table. +[[discover:enableSql]]`discover:enableSql`:: +experimental[] Allows SQL queries for search. [[discover-max-doc-fields-displayed]]`discover:maxDocFieldsDisplayed`:: Specifies the maximum number of fields to show in the document column of the *Discover* table. @@ -295,11 +295,14 @@ Specifies the maximum number of fields to show in the document column of the *Di [[discover-modify-columns-on-switch]]`discover:modifyColumnsOnSwitch`:: When enabled, removes the columns that are not in the new data view. -[[discover-sample-size]]`discover:sampleSize`:: -Specifies the number of rows to display in the *Discover* table. +[[discover-row-height-option]]`discover:rowHeightOption`:: +The number of lines to allow in a row. A value of -1 automatically adjusts the row height to fit the contents. A value of 0 displays the content in a single line. [[discover-sampleRowsPerPage]]`discover:sampleRowsPerPage`:: -Specifies the number of rows to display per page in the *Discover* table. +Limits the number of rows per page in the document table. + +[[discover-sample-size]]`discover:sampleSize`:: +Sets the maximum number of rows for the entire document table. This is the maximum number of documents fetched from {es}. [[discover-searchFieldsFromSource]]`discover:searchFieldsFromSource`:: Load fields from the original JSON {ref}/mapping-source-field.html[`_source`]. @@ -310,8 +313,12 @@ When disabled, *Discover* loads fields using the {es} search API's Controls whether a search is executed when *Discover* first loads. This setting does not have an effect when loading a saved search. +[[discover:showFieldStatistics]]`discover:showFieldStatistics`:: +beta[] Enables the Field statistics view. Examine details such as +the minimum and maximum values of a numeric field or a map of a geo field. + [[discover:showMultiFields]]`discover:showMultiFields`:: -When enabled, displays multi-fields in the expanded document view. +Controls the display of multi-fields in the expanded document view. [[discover-sort-defaultorder]]`discover:sort:defaultOrder`:: The default sort direction for time-based data views. @@ -319,9 +326,6 @@ The default sort direction for time-based data views. [[doctable-hidetimecolumn]]`doc_table:hideTimeColumn`:: Hides the "Time" column in *Discover* and in all saved searches on dashboards. -[[discover:enableSql]]`discover:enableSql`:: -When enabled, allows SQL queries for search. - [[doctable-highlight]]`doc_table:highlight`:: Highlights results in *Discover* and saved searches on dashboards. Highlighting slows requests when working on big documents. @@ -331,6 +335,10 @@ Controls the way the document table looks and works. To use the new *Document Explorer* instead of the classic view, turn off this option. The *Document Explorer* offers better data sorting, resizable columns, and a full screen view. +[[truncate-max-height]]`truncate:maxHeight`:: +The maximum height that a cell in a table can occupy. To disable truncation, set to 0. + + [float] [[kibana-ml-settings]] ==== Machine Learning @@ -448,9 +456,8 @@ Includes {ref}/frozen-indices.html[frozen indices] in results. Searching through frozen indices might increase the search time. This setting is off by default. Users must opt-in to include frozen indices. -[[search-timeout]]`search:timeout`:: Change the maximum timeout for a search -session or set to 0 to disable the timeout and allow queries to run to -completion. +[[search-timeout]]`search:timeout`:: Change the maximum timeout, in milliseconds (ms), for a search +session. To disable the timeout and allow queries to run to completion, set to 0. The default is 600,000 ms, or 10 minutes. [float] [[kibana-siem-settings]] diff --git a/docs/maps/images/gs-filter-icon.png b/docs/maps/images/gs-filter-icon.png new file mode 100644 index 0000000000000..aebe2d51873fd Binary files /dev/null and b/docs/maps/images/gs-filter-icon.png differ diff --git a/docs/maps/images/gs_add_cloropeth_layer.png b/docs/maps/images/gs_add_cloropeth_layer.png index 10774c69adbba..63dc1e3db2cfe 100644 Binary files a/docs/maps/images/gs_add_cloropeth_layer.png and b/docs/maps/images/gs_add_cloropeth_layer.png differ diff --git a/docs/maps/images/gs_add_es_document_layer.png b/docs/maps/images/gs_add_es_document_layer.png index 4656933552f26..35a9192634edc 100644 Binary files a/docs/maps/images/gs_add_es_document_layer.png and b/docs/maps/images/gs_add_es_document_layer.png differ diff --git a/docs/maps/images/gs_dashboard_with_map.png b/docs/maps/images/gs_dashboard_with_map.png index b7d4a7b63ed30..81fc181e698e9 100644 Binary files a/docs/maps/images/gs_dashboard_with_map.png and b/docs/maps/images/gs_dashboard_with_map.png differ diff --git a/docs/maps/images/gs_map_filtered.png b/docs/maps/images/gs_map_filtered.png new file mode 100644 index 0000000000000..f69b2e7397d57 Binary files /dev/null and b/docs/maps/images/gs_map_filtered.png differ diff --git a/docs/maps/images/gs_tooltip_filter.png b/docs/maps/images/gs_tooltip_filter.png new file mode 100644 index 0000000000000..3de04f846c8ae Binary files /dev/null and b/docs/maps/images/gs_tooltip_filter.png differ diff --git a/docs/maps/images/sample_data_web_logs.png b/docs/maps/images/sample_data_web_logs.png index 76ff9c0d16221..080824cf47687 100644 Binary files a/docs/maps/images/sample_data_web_logs.png and b/docs/maps/images/sample_data_web_logs.png differ diff --git a/docs/maps/maps-getting-started.asciidoc b/docs/maps/maps-getting-started.asciidoc index d4da7ef8aae2e..317a9657f1965 100644 --- a/docs/maps/maps-getting-started.asciidoc +++ b/docs/maps/maps-getting-started.asciidoc @@ -34,7 +34,7 @@ refer to <>. . Open the main menu, and then click *Dashboard*. . Click **Create dashboard**. . Set the time range to *Last 7 days*. -. Click the **Create new Maps** icon image:maps/images/app_gis_icon.png[] +. Click the **Create new Maps** icon image:maps/images/app_gis_icon.png[]. [float] [[maps-add-choropleth-layer]] @@ -46,7 +46,7 @@ and lighter shades will symbolize countries with less traffic. . Click **Add layer**, and then click **Choropleth**. -. From the **Layer** dropdown menu, select **World Countries**. +. From the **EMS boundaries** dropdown menu, select **World Countries**. . In **Statistics source**, set: ** **Data view** to **kibana_sample_data_logs** @@ -62,12 +62,12 @@ and lighter shades will symbolize countries with less traffic. . Add a Tooltip field: ** **ISO 3166-1 alpha-2 code** is added by default. -** Click **+ Add** to open field select. +** Click **+ Add** to open the field select. ** Select **name** and click *Add*. . In **Layer style**: -** Set **Fill color: As number** to the grey color ramp. +** Set **Fill color > As number** to the grey color ramp. ** Set **Border color** to white. ** Under **Label**, change **By value** to **Fixed**. @@ -76,7 +76,7 @@ and lighter shades will symbolize countries with less traffic. Your map now looks like this: + [role="screenshot"] -image::maps/images/gs_add_cloropeth_layer.png[] +image::maps/images/gs_add_cloropeth_layer.png[Map showing the Total Requests by Destination layer] [float] [[maps-add-elasticsearch-layer]] @@ -107,7 +107,7 @@ The layer is only visible when users zoom in. . Add a tooltip field and select **agent**, **bytes**, **clientip**, **host**, **machine.os**, **request**, **response**, and **timestamp**. -. In **Scaling**, set *Limits results to 10,000.* +. In **Scaling**, enable *Limit results to 10,000.* . In **Layer style**, set **Fill color** to **#2200FF**. @@ -116,7 +116,7 @@ The layer is only visible when users zoom in. Your map will look like this from zoom level 9 to 24: + [role="screenshot"] -image::maps/images/gs_add_es_document_layer.png[] +image::maps/images/gs_add_es_document_layer.png[Map showing what zoom level looks like a level 9] [float] ==== Add a layer for aggregated data @@ -140,14 +140,14 @@ grids with less bytes transferred. ** Click **Add metric**. ** Set **Aggregation** to **Sum** with **Field** set to **bytes**. . In **Layer style**, change **Symbol size**: -** Set the field select to *sum bytes*. +** Set *By value* to *sum bytes*. ** Set the min size to 7 and the max size to 25 px. . Click **Save & close** button. + Your map will look like this between zoom levels 0 and 9: + [role="screenshot"] -image::maps/images/sample_data_web_logs.png[] +image::maps/images/sample_data_web_logs.png[Map showing what zoom level 3 looks like] [float] [[maps-save]] @@ -164,10 +164,10 @@ View your geospatial data alongside a heat map and pie chart, and then filter th When you apply a filter in one panel, it is applied to all panels on the dashboard. . Click **Add from library** to open a list of panels that you can add to the dashboard. -. Add **[Logs] Unique Visitor Heatmap** and **[Logs] Bytes distribution** to the dashboard. +. Add **[Logs] Unique Destination Heatmap** and **[Logs] Bytes distribution** to the dashboard. + [role="screenshot"] -image::maps/images/gs_dashboard_with_map.png[] +image::maps/images/gs_dashboard_with_map.png[Map in a dashboard with 2 other panels] . To filter for documents with unusually high byte values, click and drag in the *Bytes distribution* chart. @@ -177,10 +177,15 @@ image::maps/images/gs_dashboard_with_map.png[] .. Open a tooltip by clicking anywhere in the United States vector. -.. To show only documents where **geo.src** is **US**, click the filter icon in the row for **ISO 3066-1 alpha-2**. +.. To show only documents where **geo.src** is **US**, click the filter icon image:maps/images/gs-filter-icon.png[filter icon, width=24px]in the row for **ISO 3066-1 alpha-2**. ++ +[role="screenshot"] +image::maps/images/gs_tooltip_filter.png[Tooltip on map, width=75%] ++ +Your filtered map should look similar to this: + [role="screenshot"] -image::maps/images/gs_dashboard_with_terms_filter.png[] +image::maps/images/gs_map_filtered.png[Map showing filtered data] [float] === What's next? diff --git a/docs/settings/alert-action-settings.asciidoc b/docs/settings/alert-action-settings.asciidoc index 95003a08b7b09..014ee4e69dca1 100644 --- a/docs/settings/alert-action-settings.asciidoc +++ b/docs/settings/alert-action-settings.asciidoc @@ -143,6 +143,22 @@ Specifies preconfigured connector IDs and configs. Default: {}. `xpack.actions.proxyUrl` {ess-icon}:: Specifies the proxy URL to use, if using a proxy for actions. By default, no proxy is used. ++ +Proxies may be used to proxy http or https requests through a proxy using the http or https protocol. Kibana only uses proxies in "CONNECT" mode (sometimes referred to as "tunneling" TCP mode, compared to HTTP mode). That is, Kibana will always make requests through a proxy using the HTTP `CONNECT` method. ++ +If your proxy is using the https protocol (vs the http protocol), the setting `xpack.actions.ssl.proxyVerificationMode: none` will likely be needed, unless your proxy's certificates are signed using a publicly available certificate authority. ++ +There is currently no support for using basic authentication with a proxy (authentication for the proxy itself, not the URL being requested through the proxy). ++ +To help diagnose problems using a proxy, you can use the `curl` command with options to use your proxy, and log debug information, with the following command, replacing the proxy and target URLs as appropriate. This will force the request to be made to the +proxy in tunneling mode, and display some of the interaction between the client and the proxy. ++ +[source,sh] +-- +curl --verbose --proxytunnel --proxy http://localhost:8080 http://example.com +-- ++ + `xpack.actions.proxyBypassHosts` {ess-icon}:: Specifies hostnames which should not use the proxy, if using a proxy for actions. The value is an array of hostnames as strings. By default, all hosts will use the proxy, but if an action's hostname is in this list, the proxy will not be used. The settings `xpack.actions.proxyBypassHosts` and `xpack.actions.proxyOnlyHosts` cannot be used at the same time. @@ -210,6 +226,9 @@ Specifies the behavior when a new or changed rule has a schedule interval less t `xpack.alerting.rules.run.actions.max` {ess-icon}:: Specifies the maximum number of actions that a rule can generate each time detection checks run. +`xpack.alerting.rules.run.alerts.max` {ess-icon}:: +Specifies the maximum number of alerts that a rule can generate each time detection checks run. Default: 1000. + `xpack.alerting.rules.run.timeout` {ess-icon}:: Specifies the default timeout for tasks associated with all types of rules. The time is formatted as: + diff --git a/docs/user/dashboard/aggregation-based.asciidoc b/docs/user/dashboard/aggregation-based.asciidoc index 842f2e93bc58e..4ca251b3a1936 100644 --- a/docs/user/dashboard/aggregation-based.asciidoc +++ b/docs/user/dashboard/aggregation-based.asciidoc @@ -140,9 +140,11 @@ a bar chart that displays the top five log traffic sources for every three hours Add the sample web logs data that you'll use to create the bar chart, then create the dashboard. -. From the *Home* page, click *Try our sample data*. +. On the home page, click *Try sample data*. -. From *Sample web logs*, click *Add data*. +. Click *Other sample data sets*. + +. On the *Sample web logs* card, click *Add data*. . Open the main menu, then click *Dashboard*. @@ -153,9 +155,9 @@ Add the sample web logs data that you'll use to create the bar chart, then creat Open the *Aggregation based* editor and change the time range. -. On the dashboard, click *All types > Aggregation based*, select *Vertical bar*, then select *kibana_sample_data_logs*. +. On the dashboard, click *All types > Aggregation based*, select *Vertical bar*, then select *Kibana Sample Data Logs*. -. Make sure the <>> is *Last 7 days*. +. Make sure the <> is *Last 7 days*. [float] [[tutorial-configure-the-bar-chart]] @@ -172,7 +174,7 @@ To create the bar chart, add a <>, then .. Click *Update*. + [role="screenshot"] -image:images/aggBased_barChartTutorial1_8.3.png[Bar chart with sample logs data] +image:images/aggBased_barChartTutorial1_8.4.png[Bar chart with sample logs data] . To show the top five log traffic sources, add a sub-bucket aggregation. @@ -187,7 +189,7 @@ TIP: Aggregation-based panels support a maximum of three *Split series*. .. Click *Update*. + [role="screenshot"] -image:images/aggBased_barChartTutorial2_8.3.png[Bar chart with sample logs data] +image:images/aggBased_barChartTutorial2_8.4.png[Bar chart with sample logs data] [float] [[save-the-aggregation-based-panel]] diff --git a/docs/user/dashboard/images/aggBased_barChartTutorial1_8.3.png b/docs/user/dashboard/images/aggBased_barChartTutorial1_8.3.png deleted file mode 100644 index a30fe3fbd1b78..0000000000000 Binary files a/docs/user/dashboard/images/aggBased_barChartTutorial1_8.3.png and /dev/null differ diff --git a/docs/user/dashboard/images/aggBased_barChartTutorial1_8.4.png b/docs/user/dashboard/images/aggBased_barChartTutorial1_8.4.png new file mode 100644 index 0000000000000..9e43d6e61a656 Binary files /dev/null and b/docs/user/dashboard/images/aggBased_barChartTutorial1_8.4.png differ diff --git a/docs/user/dashboard/images/aggBased_barChartTutorial2_8.3.png b/docs/user/dashboard/images/aggBased_barChartTutorial2_8.3.png deleted file mode 100644 index d1d7f0644db31..0000000000000 Binary files a/docs/user/dashboard/images/aggBased_barChartTutorial2_8.3.png and /dev/null differ diff --git a/docs/user/dashboard/images/aggBased_barChartTutorial2_8.4.png b/docs/user/dashboard/images/aggBased_barChartTutorial2_8.4.png new file mode 100644 index 0000000000000..ea6727c0ca47d Binary files /dev/null and b/docs/user/dashboard/images/aggBased_barChartTutorial2_8.4.png differ diff --git a/docs/user/dashboard/images/lens_dataViewDropDown_8.0.png b/docs/user/dashboard/images/lens_dataViewDropDown_8.0.png deleted file mode 100644 index 309e1be49b9db..0000000000000 Binary files a/docs/user/dashboard/images/lens_dataViewDropDown_8.0.png and /dev/null differ diff --git a/docs/user/dashboard/images/lens_dataViewDropDown_8.3.png b/docs/user/dashboard/images/lens_dataViewDropDown_8.3.png deleted file mode 100644 index 857f28303b8cb..0000000000000 Binary files a/docs/user/dashboard/images/lens_dataViewDropDown_8.3.png and /dev/null differ diff --git a/docs/user/dashboard/images/lens_dataViewDropDown_8.4.0.png b/docs/user/dashboard/images/lens_dataViewDropDown_8.4.0.png new file mode 100644 index 0000000000000..990cebfc51f6f Binary files /dev/null and b/docs/user/dashboard/images/lens_dataViewDropDown_8.4.0.png differ diff --git a/docs/user/dashboard/images/lens_lineChartMetricOverTime_8.4.0.png b/docs/user/dashboard/images/lens_lineChartMetricOverTime_8.4.0.png new file mode 100644 index 0000000000000..9ed9b4730fae4 Binary files /dev/null and b/docs/user/dashboard/images/lens_lineChartMetricOverTime_8.4.0.png differ diff --git a/docs/user/dashboard/images/lens_logsDashboard_7.16.png b/docs/user/dashboard/images/lens_logsDashboard_7.16.png deleted file mode 100644 index cdfe0accdbbb5..0000000000000 Binary files a/docs/user/dashboard/images/lens_logsDashboard_7.16.png and /dev/null differ diff --git a/docs/user/dashboard/images/lens_logsDashboard_8.3.png b/docs/user/dashboard/images/lens_logsDashboard_8.3.png deleted file mode 100644 index 089fd5dcadb0c..0000000000000 Binary files a/docs/user/dashboard/images/lens_logsDashboard_8.3.png and /dev/null differ diff --git a/docs/user/dashboard/images/lens_logsDashboard_8.4.0.png b/docs/user/dashboard/images/lens_logsDashboard_8.4.0.png new file mode 100644 index 0000000000000..1801fea4e0620 Binary files /dev/null and b/docs/user/dashboard/images/lens_logsDashboard_8.4.0.png differ diff --git a/docs/user/dashboard/images/lens_metricUniqueCountOfClientip_7.16.png b/docs/user/dashboard/images/lens_metricUniqueCountOfClientip_7.16.png deleted file mode 100644 index bed6acf501a3a..0000000000000 Binary files a/docs/user/dashboard/images/lens_metricUniqueCountOfClientip_7.16.png and /dev/null differ diff --git a/docs/user/dashboard/images/lens_metricUniqueCountOfClientip_8.4.0.png b/docs/user/dashboard/images/lens_metricUniqueCountOfClientip_8.4.0.png new file mode 100644 index 0000000000000..f3b1603b50bef Binary files /dev/null and b/docs/user/dashboard/images/lens_metricUniqueCountOfClientip_8.4.0.png differ diff --git a/docs/user/dashboard/images/lens_pieChartCompareSubsetOfDocs_7.16.png b/docs/user/dashboard/images/lens_pieChartCompareSubsetOfDocs_7.16.png index f8e8ba98f691e..fdeca77da25fb 100644 Binary files a/docs/user/dashboard/images/lens_pieChartCompareSubsetOfDocs_7.16.png and b/docs/user/dashboard/images/lens_pieChartCompareSubsetOfDocs_7.16.png differ diff --git a/docs/user/dashboard/images/lens_visualizationTypeDropdown_8.0.png b/docs/user/dashboard/images/lens_visualizationTypeDropdown_8.0.png deleted file mode 100644 index 3a7cc44b820ee..0000000000000 Binary files a/docs/user/dashboard/images/lens_visualizationTypeDropdown_8.0.png and /dev/null differ diff --git a/docs/user/dashboard/images/lens_visualizationTypeDropdown_8.4.0.png b/docs/user/dashboard/images/lens_visualizationTypeDropdown_8.4.0.png new file mode 100644 index 0000000000000..a86dbed105eff Binary files /dev/null and b/docs/user/dashboard/images/lens_visualizationTypeDropdown_8.4.0.png differ diff --git a/docs/user/dashboard/lens-advanced.asciidoc b/docs/user/dashboard/lens-advanced.asciidoc index 68516b49d2158..04822444c530e 100644 --- a/docs/user/dashboard/lens-advanced.asciidoc +++ b/docs/user/dashboard/lens-advanced.asciidoc @@ -16,7 +16,9 @@ Before you begin, you should be familiar with the <>. Add the sample ecommerce data, and create and set up the dashboard. -. Go to the *Home* page, then click *Try sample data*. +. On the home page, click *Try sample data*. + +. Click *Other sample data sets*. . On the *Sample eCommerce orders* card, click *Add data*. diff --git a/docs/user/dashboard/lens.asciidoc b/docs/user/dashboard/lens.asciidoc index 8e8ffe902a565..80e1665753c15 100644 --- a/docs/user/dashboard/lens.asciidoc +++ b/docs/user/dashboard/lens.asciidoc @@ -73,7 +73,7 @@ Change the fields list to display a different {data-source}, different time rang * To add fields, open the {data-source} dropdown, then select *Add a field to this {data-source}*. + [role="screenshot"] -image:images/lens_dataViewDropDown_8.3.png[Dropdown menu located next to {data-source} field with items for adding and managing fields] +image:images/lens_dataViewDropDown_8.4.0.png[Dropdown menu located next to {data-source} field with items for adding and managing fields] + For more information about adding fields to {data-sources} and examples, refer to <>. diff --git a/docs/user/dashboard/tutorial-create-a-dashboard-of-lens-panels.asciidoc b/docs/user/dashboard/tutorial-create-a-dashboard-of-lens-panels.asciidoc index 1d4d5d70e879e..95f937bb65443 100644 --- a/docs/user/dashboard/tutorial-create-a-dashboard-of-lens-panels.asciidoc +++ b/docs/user/dashboard/tutorial-create-a-dashboard-of-lens-panels.asciidoc @@ -8,7 +8,7 @@ at website logs, but this type of dashboard works on any type of data. When you're done, you'll have a complete overview of the sample web logs data. [role="screenshot"] -image::images/lens_logsDashboard_8.3.png[Logs dashboard] +image::images/lens_logsDashboard_8.4.0.png[Logs dashboard] Before you begin, you should be familiar with the <>. @@ -18,7 +18,9 @@ Before you begin, you should be familiar with the <>. Add the sample web logs data, and create and set up the dashboard. -. Go to the *Home* page, then click *Try sample data*. +. On the home page, click *Try sample data*. + +. Click *Other sample data sets*. . On the *Sample web logs* card, click *Add data*. @@ -38,10 +40,10 @@ Open the visualization editor, then make sure the correct fields appear. . On the dashboard, click *Create visualization*. -. Make sure the *kibana_sample_data_logs* data view appears. +. Make sure the *{kib} Sample Data Logs* {data-source} appears. + [role="screenshot"] -image::images/lens_dataViewDropDown_8.3.png[Data view dropdown] +image::images/lens_dataViewDropDown_8.4.0.png[Data view dropdown] To create the visualizations in this tutorial, you'll use the following fields: @@ -68,12 +70,12 @@ The only number function that you can use with *clientip* is *Unique count*, als . Open the *Visualization type* dropdown, then select *Metric*. + [role="screenshot"] -image::images/lens_visualizationTypeDropdown_8.0.png[Visualization type dropdown] +image::images/lens_visualizationTypeDropdown_8.4.0.png[Visualization type dropdown] . From the *Available fields* list, drag *clientip* to the workspace or layer pane. + [role="screenshot"] -image::images/lens_metricUniqueCountOfClientip_7.16.png[Metric visualization of the clientip field] +image::images/lens_metricUniqueCountOfClientip_8.4.0.png[Metric visualization of the clientip field] + In the layer pane, *Unique count of clientip* appears because the editor automatically applies the *Unique count* function to the *clientip* field. *Unique count* is the only numeric function that works with IP addresses. @@ -133,7 +135,7 @@ image::images/lens_lineChartMetricOverTimeLeftAxis_8.3.png[Left axis menu] . Open the *Bottom axis* menu, then select *None* from the *Axis title* dropdown. + [role="screenshot"] -image::images/lens_lineChartMetricOverTimeBottomAxis_8.3.png[Line chart that displays metric data over time] +image::images/lens_lineChartMetricOverTimeBottomAxis_8.3.png[Bottom axis menu] . Click *Save and return* @@ -142,6 +144,9 @@ Since you removed the axis labels, add a panel title: . Open the panel menu, then select *Edit panel title*. . In the *Panel title* field, enter `Median of bytes`, then click *Save*. ++ +[role="screenshot"] +image::images/lens_lineChartMetricOverTime_8.4.0.png[Line chart that displays metric data over time] [discrete] [[view-the-distribution-of-visitors-by-operating-system]] @@ -174,7 +179,7 @@ The chart labels are unable to display because the *request.keyword* field conta [role="screenshot"] image::images/lens_end_to_end_2_1_2.png[Table with top values of request.keyword by most unique visitors] -. In the layer pane, click *Top values of request.keyword*. +. In the layer pane, click *Top 5 values of request.keyword*. .. In the *Number of values* field, enter `10`. @@ -201,7 +206,7 @@ Create a proportional visualization that helps you determine if your users trans . In the layer pane, click *Median of bytes*. -. Click the *Sum* function, then click *Close*. +. Click the *Sum* quick function, then click *Close*. . From the *Available fields* list, drag *bytes* to the *Break down by* field in the layer pane. @@ -256,7 +261,7 @@ The distribution of a number can help you find patterns. For example, you can an . In the layer pane, click *Median of bytes*. -.. Click the *Sum* function. +.. Click the *Sum* quick function. .. In the *Name* field, enter `Transferred bytes`. @@ -293,7 +298,7 @@ Add a panel title: Create a filter for each website traffic source: -. Click the *Filters* function. +. Click *Filters*. . Click *All records*, enter the following in the query bar, then press Return: @@ -319,14 +324,14 @@ Add the user geography grouping: . From the *Available fields* list, drag *geo.srcdest* to the workspace. -. To change the *Group by* order, drag *Top values of geo.srcdest* in the layer pane so that appears first. +. To change the *Group by* order, drag *Top 3 values of geo.srcdest* in the layer pane so that appears first. + [role="screenshot"] image::images/lens_end_to_end_7_2.png[Treemap visualization] Remove the documents that do not match the filter criteria: -. In the layer pane, click *Top values of geo.srcdest*. +. In the layer pane, click *Top 3 values of geo.srcdest*. . Click *Advanced*, deselect *Group other values as "Other"*, then click *Close*. + @@ -358,7 +363,7 @@ Decrease the size of the following panels, then move the panels to the first row * *Website traffic* + [role="screenshot"] -image::images/lens_logsDashboard_8.3.png[Logs dashboard] +image::images/lens_logsDashboard_8.4.0.png[Logs dashboard] [discrete] === Save the dashboard diff --git a/docs/user/dashboard/vega.asciidoc b/docs/user/dashboard/vega.asciidoc index 9c58b9d0ecf49..371b8b949c72a 100644 --- a/docs/user/dashboard/vega.asciidoc +++ b/docs/user/dashboard/vega.asciidoc @@ -40,9 +40,11 @@ As you edit the specs, work in small steps, and frequently save your work. Small Before starting, add the eCommerce sample data that you'll use in your spec, then create the dashboard. -. From the {kib} *Home* page, click *Try our sample data*. +. On the home page, click *Try sample data*. -. From *eCommerce sample data*, click *Add data*. +. Click *Other sample data sets*. + +. On the *Sample eCommerce orders* card, click *Add data*. . Open the main menu, then click *Dashboard*. diff --git a/docs/user/discover.asciidoc b/docs/user/discover.asciidoc index 26a6eafd8086d..fab5dc372feac 100644 --- a/docs/user/discover.asciidoc +++ b/docs/user/discover.asciidoc @@ -54,7 +54,7 @@ Tell {kib} where to find the data you want to explore, and then specify the time + {kib} uses a <> to tell it where to find your {es} data. -To view the ecommerce sample data, open the {data-source} menu, and select **kibana_sample_data_ecommerce**. +To view the ecommerce sample data, open the {data-source} menu, and then select **Kibana Sample Data Ecommerce**. + [role="screenshot"] image::images/discover-data-view.png[How to set the {data-source} in Discover, width=50%] @@ -118,7 +118,7 @@ You can add a runtime field to your {data-source} from inside of **Discover**, and then use that field for analysis and visualizations, the same way you do with other fields. -. Open the data view menu, and then click *Add a field to this data view*. +. In the sidebar, click *Add a field*. . In the *Create field* form, enter `hello` for the name. @@ -191,7 +191,7 @@ and more. Exclude documents where day of week is not Wednesday: -. Click image:images/add-icon.png[Add icon] to the left of the query bar. +. Click image:images/add-icon.png[Add icon] next to the query bar. . In the *Add filter* pop-up, set *Field* to *day_of_week*, *Operator* to *is not*, and *Value* to *Wednesday*. + [role="screenshot"] @@ -289,7 +289,7 @@ The *Create rule* form is pre-filled with the latest query sent to {es}. . Click *Save*. -For more about this and other rules provided in {kib} {alert-features}, go to <>. +For more about this and other rules provided in {alert-features}, go to <>. [float] diff --git a/docs/user/security/api-keys/index.asciidoc b/docs/user/security/api-keys/index.asciidoc index 3011f17ee08c8..3efb2cdeef6ca 100644 --- a/docs/user/security/api-keys/index.asciidoc +++ b/docs/user/security/api-keys/index.asciidoc @@ -47,7 +47,7 @@ curl --location --request GET 'http://localhost:5601/api/security/role' \ [IMPORTANT] ============================================================================ -API keys are intended for programatic access to {kib} and {es). Do not use API keys to authenticate access via a web browser. +API keys are intended for programmatic access to {kib} and {es}. Do not use API keys to authenticate access via a web browser. ============================================================================ [float] diff --git a/docs/user/security/authentication/index.asciidoc b/docs/user/security/authentication/index.asciidoc index 9b3d4b0f831f8..d0280ca8e2f40 100644 --- a/docs/user/security/authentication/index.asciidoc +++ b/docs/user/security/authentication/index.asciidoc @@ -396,7 +396,7 @@ This type of authentication is usually useful for machine-to-machine interaction [IMPORTANT] ============================================================================ -API keys are intended for programatic access to {kib} and {es). Do not use API keys to authenticate access via a web browser. +API keys are intended for programmatic access to {kib} and {es}. Do not use API keys to authenticate access via a web browser. ============================================================================ diff --git a/fleet_packages.json b/fleet_packages.json index 257d5681099ef..c44aa910e6a0f 100644 --- a/fleet_packages.json +++ b/fleet_packages.json @@ -1,15 +1,14 @@ /* - Packages in this file are considered "bundled" and are installed as part of Fleet's setup process. Each entry points to a valid version name - avaiable in the Elastic Package Registry service, and must include a sha-512 checksum of the `.zip` archive for the given package. + Packages listed in this file are "bundled" with Kibana's built distributable, and are available + on disk rather than only in the configured package registry service. This allows Kibana to install + "stack-aligned" packages or those that are installed by default in an airgapped or offline environment. - You may opt in to using the "snapshot" environment of the EPR service by passing the `--use-epr-snapshot-registry` flag to `yarn build`. This will - cause the package archive download to pull from the "spapshot" environment instead of the "production" environment. Be aware that not all packages - exist in the snapshot environment, so you may have errors when fetching package versions. It's recommended to alter this file to contain _only_ the - packages you're testing when using the snapshot environment. + Packages will be fetched from https://epr-snapshot.elastic.co by default. This can be overridden + via the `--epr-registry=production` command line argument when building Kibana. Fetching from the + snapshot registry allows Kibana to bundle packages that have yet to be published to production in + order to prepare build candidates for the next release. - These files don't include any kind of checksum, but they should eventually include a package signature as introduced in https://github.com/elastic/elastic-package/issues/583 - in order to verify package integrity. */ [ @@ -23,7 +22,7 @@ }, { "name": "endpoint", - "version": "8.3.0" + "version": "8.4.1" }, { "name": "fleet_server", diff --git a/legacy_rfcs/text/0015_bazel.md b/legacy_rfcs/text/0015_bazel.md index 82c93c3c7e9c1..390a2d68eb7ab 100644 --- a/legacy_rfcs/text/0015_bazel.md +++ b/legacy_rfcs/text/0015_bazel.md @@ -191,9 +191,9 @@ A `BUILD.bazel` file will be added to the root of each package defining a `build The `@kbn/pm` package was updated in https://github.com/elastic/kibana/pull/89961 to run the new packages build target, invoked by calling `bazel build //packages:build`, before executing the existing legacy package builds. -The build targets will no longer reside within the package themselves and instead will be within the `bazel/bin` directory. To account for this, any defined dependency will need to be updated to reference the new directory (example: `link:bazel/bin/packages/elastic-datemath`). While also in this transition period, the build will need to copy over the packages from `bazel/bin` into the `node_modules` of the build target. +The build targets will no longer reside within the package themselves and instead will be within the `bazel/bin` directory. To account for this, any defined dependency will need to be updated to reference the new directory (example: `link:bazel/bin/packages/kbn-datemath`). While also in this transition period, the build will need to copy over the packages from `bazel/bin` into the `node_modules` of the build target. -Example package BUILD.bazel for `packages/elastic-datemath`: +Example package BUILD.bazel for `packages/kbn-datemath`: ```python load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm") diff --git a/nav-kibana-dev.docnav.json b/nav-kibana-dev.docnav.json index 75d0acdc8a9da..c1ea6f702483c 100644 --- a/nav-kibana-dev.docnav.json +++ b/nav-kibana-dev.docnav.json @@ -94,6 +94,9 @@ }, { "id": "kibDevKeyConceptsNavigation" + }, + { + "id": "kibDevDocsEmbeddables" } ] }, diff --git a/package.json b/package.json index c080f0f96612d..1066262b34267 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,9 @@ "**/refractor/prismjs": "~1.27.0", "**/trim": "1.0.1", "**/typescript": "4.6.3", + "**/use-composed-ref": "^1.3.0", + "**/use-latest": "^1.2.1", + "@tanstack/query-core": "^4.2.1", "globby/fast-glob": "3.2.7", "puppeteer/node-fetch": "^2.6.7" }, @@ -102,8 +105,7 @@ "@dnd-kit/utilities": "^2.0.0", "@elastic/apm-rum": "^5.12.0", "@elastic/apm-rum-react": "^1.4.2", - "@elastic/apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace", - "@elastic/charts": "47.1.1", + "@elastic/charts": "47.2.0", "@elastic/datemath": "5.0.3", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.3.0-canary.1", "@elastic/ems-client": "8.3.3", @@ -113,7 +115,6 @@ "@elastic/numeral": "^2.5.1", "@elastic/react-search-ui": "^1.14.0", "@elastic/request-crypto": "2.0.1", - "@elastic/safer-lodash-set": "link:bazel-bin/packages/elastic-safer-lodash-set", "@elastic/search-ui-app-search-connector": "^1.14.0", "@emotion/cache": "^11.9.3", "@emotion/css": "^11.9.0", @@ -139,7 +140,9 @@ "@kbn/analytics-shippers-elastic-v3-server": "link:bazel-bin/packages/analytics/shippers/elastic_v3/server", "@kbn/analytics-shippers-fullstory": "link:bazel-bin/packages/analytics/shippers/fullstory", "@kbn/apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader", + "@kbn/apm-synthtrace": "link:bazel-bin/packages/kbn-apm-synthtrace", "@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils", + "@kbn/chart-icons": "link:bazel-bin/packages/kbn-chart-icons", "@kbn/coloring": "link:bazel-bin/packages/kbn-coloring", "@kbn/config": "link:bazel-bin/packages/kbn-config", "@kbn/config-mocks": "link:bazel-bin/packages/kbn-config-mocks", @@ -281,6 +284,7 @@ "@kbn/plugin-discovery": "link:bazel-bin/packages/kbn-plugin-discovery", "@kbn/react-field": "link:bazel-bin/packages/kbn-react-field", "@kbn/rule-data-utils": "link:bazel-bin/packages/kbn-rule-data-utils", + "@kbn/safer-lodash-set": "link:bazel-bin/packages/kbn-safer-lodash-set", "@kbn/securitysolution-autocomplete": "link:bazel-bin/packages/kbn-securitysolution-autocomplete", "@kbn/securitysolution-es-utils": "link:bazel-bin/packages/kbn-securitysolution-es-utils", "@kbn/securitysolution-hook-utils": "link:bazel-bin/packages/kbn-securitysolution-hook-utils", @@ -306,7 +310,6 @@ "@kbn/shared-ux-card-no-data": "link:bazel-bin/packages/shared-ux/card/no_data/impl", "@kbn/shared-ux-card-no-data-mocks": "link:bazel-bin/packages/shared-ux/card/no_data/mocks", "@kbn/shared-ux-card-no-data-types": "link:bazel-bin/packages/shared-ux/card/no_data/types", - "@kbn/shared-ux-components": "link:bazel-bin/packages/kbn-shared-ux-components", "@kbn/shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app/impl", "@kbn/shared-ux-link-redirect-app-mocks": "link:bazel-bin/packages/shared-ux/link/redirect_app/mocks", "@kbn/shared-ux-link-redirect-app-types": "link:bazel-bin/packages/shared-ux/link/redirect_app/types", @@ -316,12 +319,20 @@ "@kbn/shared-ux-page-kibana-no-data": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/impl", "@kbn/shared-ux-page-kibana-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/mocks", "@kbn/shared-ux-page-kibana-no-data-types": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/types", + "@kbn/shared-ux-page-kibana-template": "link:bazel-bin/packages/shared-ux/page/kibana_template/impl", + "@kbn/shared-ux-page-kibana-template-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_template/mocks", + "@kbn/shared-ux-page-kibana-template-types": "link:bazel-bin/packages/shared-ux/page/kibana_template/types", + "@kbn/shared-ux-page-no-data": "link:bazel-bin/packages/shared-ux/page/no_data/impl", + "@kbn/shared-ux-page-no-data-config": "link:bazel-bin/packages/shared-ux/page/no_data_config/impl", + "@kbn/shared-ux-page-no-data-config-mocks": "link:bazel-bin/packages/shared-ux/page/no_data_config/mocks", + "@kbn/shared-ux-page-no-data-config-types": "link:bazel-bin/packages/shared-ux/page/no_data_config/types", + "@kbn/shared-ux-page-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/no_data/mocks", + "@kbn/shared-ux-page-no-data-types": "link:bazel-bin/packages/shared-ux/page/no_data/types", "@kbn/shared-ux-page-solution-nav": "link:bazel-bin/packages/shared-ux/page/solution_nav", "@kbn/shared-ux-prompt-no-data-views": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/impl", "@kbn/shared-ux-prompt-no-data-views-mocks": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/mocks", "@kbn/shared-ux-prompt-no-data-views-types": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/types", - "@kbn/shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services", - "@kbn/shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook", + "@kbn/shared-ux-storybook-config": "link:bazel-bin/packages/shared-ux/storybook/config", "@kbn/shared-ux-storybook-mock": "link:bazel-bin/packages/shared-ux/storybook/mock", "@kbn/shared-ux-utility": "link:bazel-bin/packages/kbn-shared-ux-utility", "@kbn/std": "link:bazel-bin/packages/kbn-std", @@ -352,6 +363,8 @@ "@opentelemetry/semantic-conventions": "^1.4.0", "@reduxjs/toolkit": "^1.6.1", "@slack/webhook": "^5.0.4", + "@tanstack/react-query": "^4.2.1", + "@tanstack/react-query-devtools": "^4.2.1", "@turf/along": "6.0.1", "@turf/area": "6.0.1", "@turf/bbox": "6.0.1", @@ -379,7 +392,7 @@ "color": "^4.2.3", "commander": "^4.1.1", "compare-versions": "3.5.1", - "constate": "^1.3.2", + "constate": "^3.3.2", "content-disposition": "^0.5.4", "copy-to-clipboard": "^3.0.8", "core-js": "^3.23.5", @@ -488,7 +501,7 @@ "pluralize": "3.1.0", "polished": "^3.7.2", "pretty-ms": "6.0.0", - "prop-types": "^15.7.2", + "prop-types": "^15.8.1", "proxy-from-env": "1.0.0", "puid": "1.0.7", "puppeteer": "^10.2.0", @@ -496,39 +509,38 @@ "rbush": "^3.0.1", "re-resizable": "^6.1.1", "re2": "1.17.4", - "react": "^16.14.0", + "react": "^17.0.2", "react-ace": "^7.0.5", "react-beautiful-dnd": "^13.1.0", "react-color": "^2.13.8", - "react-dom": "^16.14.0", + "react-dom": "^17.0.2", "react-dropzone": "^4.2.9", "react-fast-compare": "^2.0.4", - "react-grid-layout": "^0.16.2", + "react-focus-on": "^3.6.0", + "react-grid-layout": "^1.3.4", "react-hook-form": "^7.30.0", "react-intl": "^2.8.0", - "react-is": "^16.13.1", - "react-markdown": "^4.3.1", + "react-is": "^17.0.2", + "react-markdown": "^6.0.3", "react-moment-proptypes": "^1.7.0", "react-monaco-editor": "^0.41.2", - "react-popper-tooltip": "^2.10.1", - "react-query": "^3.39.1", - "react-redux": "^7.2.0", - "react-resizable": "^1.7.5", - "react-resize-detector": "^4.2.0", - "react-reverse-portal": "^1.0.4", + "react-popper-tooltip": "^3.1.1", + "react-redux": "^7.2.8", + "react-resizable": "^3.0.4", + "react-resize-detector": "^7.1.1", + "react-reverse-portal": "^2.1.0", "react-router": "^5.2.0", "react-router-config": "^5.1.1", "react-router-dom": "^5.2.0", - "react-router-redux": "^4.0.8", - "react-shortcuts": "^2.0.0", - "react-sizeme": "^2.6.6", + "react-shortcuts": "^2.1.0", + "react-sizeme": "^3.0.2", "react-syntax-highlighter": "^15.3.1", "react-tiny-virtual-list": "^2.2.0", "react-use": "^15.3.8", - "react-virtualized": "^9.21.2", + "react-virtualized": "^9.22.3", "react-vis": "^1.8.1", "react-visibility-sensor": "^5.1.1", - "recompose": "^0.26.0", + "recompose": "^0.30.0", "reduce-reducers": "^1.0.4", "redux": "^4.1.0", "redux-actions": "^2.6.5", @@ -538,7 +550,6 @@ "redux-saga": "^1.1.3", "redux-thunk": "^2.3.0", "redux-thunks": "^1.0.0", - "regenerator-runtime": "^0.13.3", "remark-parse": "^8.0.3", "remark-stringify": "^8.0.3", "require-in-the-middle": "^5.1.0", @@ -579,30 +590,32 @@ "vinyl": "^2.2.0", "whatwg-fetch": "^3.0.0", "xml2js": "^0.4.22", + "xterm": "^4.18.0", + "xterm-addon-fit": "^0.5.0", "yauzl": "^2.10.0" }, "devDependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@babel/cli": "^7.18.9", - "@babel/core": "^7.18.9", + "@babel/cli": "^7.18.10", + "@babel/core": "^7.18.10", "@babel/eslint-parser": "^7.18.9", - "@babel/eslint-plugin": "^7.17.7", - "@babel/generator": "^7.18.9", + "@babel/eslint-plugin": "^7.18.10", + "@babel/generator": "^7.18.12", "@babel/helper-plugin-utils": "^7.18.9", - "@babel/parser": "^7.18.9", + "@babel/parser": "^7.18.11", "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-proposal-export-namespace-from": "^7.18.9", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", "@babel/plugin-proposal-object-rest-spread": "^7.18.9", "@babel/plugin-proposal-optional-chaining": "^7.18.9", "@babel/plugin-proposal-private-methods": "^7.18.6", - "@babel/plugin-transform-runtime": "^7.18.9", - "@babel/preset-env": "^7.18.9", + "@babel/plugin-transform-runtime": "^7.18.10", + "@babel/preset-env": "^7.18.10", "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.18.6", "@babel/register": "^7.18.9", - "@babel/traverse": "^7.18.9", - "@babel/types": "^7.18.9", + "@babel/traverse": "^7.18.11", + "@babel/types": "^7.18.10", "@bazel/ibazel": "^0.16.2", "@bazel/typescript": "4.6.2", "@cypress/code-coverage": "^3.9.12", @@ -683,11 +696,13 @@ "@storybook/addon-storyshots": "^6.4.22", "@storybook/addons": "^6.4.22", "@storybook/api": "^6.4.22", + "@storybook/client-api": "^6.4.22", "@storybook/components": "^6.4.22", "@storybook/core": "^6.4.22", "@storybook/core-common": "^6.4.22", "@storybook/core-events": "^6.4.22", "@storybook/node-logger": "^6.4.22", + "@storybook/preview-web": "^6.4.22", "@storybook/react": "^6.4.22", "@storybook/testing-react": "^1.2.4", "@storybook/theming": "^6.4.22", @@ -723,8 +738,7 @@ "@types/deep-freeze-strict": "^1.1.0", "@types/delete-empty": "^2.0.0", "@types/ejs": "^3.0.6", - "@types/elastic__apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace/npm_module_types", - "@types/enzyme": "^3.10.8", + "@types/enzyme": "^3.10.12", "@types/eslint": "^7.28.0", "@types/express": "^4.17.13", "@types/extract-zip": "^1.6.2", @@ -751,7 +765,6 @@ "@types/intl-relativeformat": "^2.1.0", "@types/jest": "^26.0.22", "@types/jest-axe": "^3.5.3", - "@types/jest-specific-snapshot": "^0.5.5", "@types/joi": "^17.2.3", "@types/jquery": "^3.3.31", "@types/js-levenshtein": "^1.1.0", @@ -773,10 +786,12 @@ "@types/kbn__analytics-shippers-elastic-v3-server": "link:bazel-bin/packages/analytics/shippers/elastic_v3/server/npm_module_types", "@types/kbn__analytics-shippers-fullstory": "link:bazel-bin/packages/analytics/shippers/fullstory/npm_module_types", "@types/kbn__apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader/npm_module_types", + "@types/kbn__apm-synthtrace": "link:bazel-bin/packages/kbn-apm-synthtrace/npm_module_types", "@types/kbn__apm-utils": "link:bazel-bin/packages/kbn-apm-utils/npm_module_types", "@types/kbn__axe-config": "link:bazel-bin/packages/kbn-axe-config/npm_module_types", "@types/kbn__bazel-packages": "link:bazel-bin/packages/kbn-bazel-packages/npm_module_types", "@types/kbn__bazel-runner": "link:bazel-bin/packages/kbn-bazel-runner/npm_module_types", + "@types/kbn__chart-icons": "link:bazel-bin/packages/kbn-chart-icons/npm_module_types", "@types/kbn__ci-stats-core": "link:bazel-bin/packages/kbn-ci-stats-core/npm_module_types", "@types/kbn__ci-stats-performance-metrics": "link:bazel-bin/packages/kbn-ci-stats-performance-metrics/npm_module_types", "@types/kbn__ci-stats-reporter": "link:bazel-bin/packages/kbn-ci-stats-reporter/npm_module_types", @@ -972,7 +987,6 @@ "@types/kbn__shared-ux-card-no-data": "link:bazel-bin/packages/shared-ux/card/no_data/impl/npm_module_types", "@types/kbn__shared-ux-card-no-data-mocks": "link:bazel-bin/packages/shared-ux/card/no_data/mocks/npm_module_types", "@types/kbn__shared-ux-card-no-data-types": "link:bazel-bin/packages/shared-ux/card/no_data/types/npm_module_types", - "@types/kbn__shared-ux-components": "link:bazel-bin/packages/kbn-shared-ux-components/npm_module_types", "@types/kbn__shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app/impl/npm_module_types", "@types/kbn__shared-ux-link-redirect-app-mocks": "link:bazel-bin/packages/shared-ux/link/redirect_app/mocks/npm_module_types", "@types/kbn__shared-ux-link-redirect-app-types": "link:bazel-bin/packages/shared-ux/link/redirect_app/types/npm_module_types", @@ -982,12 +996,20 @@ "@types/kbn__shared-ux-page-kibana-no-data": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/impl/npm_module_types", "@types/kbn__shared-ux-page-kibana-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/mocks/npm_module_types", "@types/kbn__shared-ux-page-kibana-no-data-types": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/types/npm_module_types", + "@types/kbn__shared-ux-page-kibana-template": "link:bazel-bin/packages/shared-ux/page/kibana_template/impl/npm_module_types", + "@types/kbn__shared-ux-page-kibana-template-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_template/mocks/npm_module_types", + "@types/kbn__shared-ux-page-kibana-template-types": "link:bazel-bin/packages/shared-ux/page/kibana_template/types/npm_module_types", + "@types/kbn__shared-ux-page-no-data": "link:bazel-bin/packages/shared-ux/page/no_data/impl/npm_module_types", + "@types/kbn__shared-ux-page-no-data-config": "link:bazel-bin/packages/shared-ux/page/no_data_config/impl/npm_module_types", + "@types/kbn__shared-ux-page-no-data-config-mocks": "link:bazel-bin/packages/shared-ux/page/no_data_config/mocks/npm_module_types", + "@types/kbn__shared-ux-page-no-data-config-types": "link:bazel-bin/packages/shared-ux/page/no_data_config/types/npm_module_types", + "@types/kbn__shared-ux-page-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/no_data/mocks/npm_module_types", + "@types/kbn__shared-ux-page-no-data-types": "link:bazel-bin/packages/shared-ux/page/no_data/types/npm_module_types", "@types/kbn__shared-ux-page-solution-nav": "link:bazel-bin/packages/shared-ux/page/solution_nav/npm_module_types", "@types/kbn__shared-ux-prompt-no-data-views": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/impl/npm_module_types", "@types/kbn__shared-ux-prompt-no-data-views-mocks": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/mocks/npm_module_types", "@types/kbn__shared-ux-prompt-no-data-views-types": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/types/npm_module_types", - "@types/kbn__shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services/npm_module_types", - "@types/kbn__shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook/npm_module_types", + "@types/kbn__shared-ux-storybook-config": "link:bazel-bin/packages/shared-ux/storybook/config/npm_module_types", "@types/kbn__shared-ux-storybook-mock": "link:bazel-bin/packages/shared-ux/storybook/mock/npm_module_types", "@types/kbn__shared-ux-utility": "link:bazel-bin/packages/kbn-shared-ux-utility/npm_module_types", "@types/kbn__some-dev-log": "link:bazel-bin/packages/kbn-some-dev-log/npm_module_types", @@ -1046,23 +1068,22 @@ "@types/pngjs": "^3.4.0", "@types/prettier": "^2.3.2", "@types/pretty-ms": "^5.0.0", - "@types/prop-types": "^15.7.3", + "@types/prop-types": "^15.7.5", "@types/rbush": "^3.0.0", - "@types/react": "^16.14.25", + "@types/react": "^17.0.45", "@types/react-beautiful-dnd": "^13.0.0", - "@types/react-dom": "^16.9.15", - "@types/react-grid-layout": "^0.16.7", + "@types/react-dom": "^17.0.17", + "@types/react-grid-layout": "^1.3.2", "@types/react-intl": "^2.3.15", - "@types/react-is": "^16.7.2", - "@types/react-redux": "^7.1.9", - "@types/react-resize-detector": "^4.0.1", + "@types/react-is": "^17.0.3", + "@types/react-resize-detector": "^6.1.0", "@types/react-router": "^5.1.7", "@types/react-router-config": "^5.0.2", "@types/react-router-dom": "^5.1.5", - "@types/react-test-renderer": "^16.9.1", - "@types/react-virtualized": "^9.18.7", + "@types/react-test-renderer": "^17.0.2", + "@types/react-virtualized": "^9.21.21", "@types/react-vis": "^1.11.9", - "@types/recompose": "^0.30.6", + "@types/recompose": "^0.30.10", "@types/reduce-reducers": "^1.0.0", "@types/redux-actions": "^2.6.1", "@types/redux-logger": "^3.0.8", @@ -1102,6 +1123,7 @@ "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", "@typescript-eslint/typescript-estree": "^5.20.0", + "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7", "@yarnpkg/lockfile": "^1.1.0", "abab": "^2.0.4", "aggregate-error": "^3.1.0", @@ -1147,8 +1169,6 @@ "dpdm": "3.5.0", "ejs": "^3.1.8", "enzyme": "^3.11.0", - "enzyme-adapter-react-16": "^1.15.6", - "enzyme-adapter-utils": "^1.14.0", "enzyme-to-json": "^3.6.1", "eslint": "^7.32.0", "eslint-config-prettier": "^8.5.0", @@ -1176,9 +1196,7 @@ "file-loader": "^4.2.0", "form-data": "^4.0.0", "geckodriver": "^3.0.2", - "gulp-babel": "^8.0.0", "gulp-brotli": "^3.0.0", - "gulp-gzip": "^1.4.2", "gulp-postcss": "^9.0.1", "gulp-sourcemaps": "2.6.5", "gulp-terser": "^2.1.0", @@ -1198,15 +1216,15 @@ "jest-config": "^26", "jest-diff": "^26.6.2", "jest-environment-jsdom": "^26.6.2", - "jest-environment-jsdom-thirteen": "^1.0.1", + "jest-mock": "^26.6.2", "jest-raw-loader": "^1.0.1", "jest-runtime": "^26", "jest-silent-reporter": "^0.5.0", "jest-snapshot": "^26.6.2", - "jest-specific-snapshot": "2.0.0", + "jest-specific-snapshot": "^4.0.0", "jest-styled-components": "^7.0.3", "jimp": "^0.14.0", - "jsdom": "13.1.0", + "jsdom": "^16.4.0", "json-schema-typed": "^8.0.1", "json5": "^1.0.1", "jsondiffpatch": "0.4.1", @@ -1234,6 +1252,7 @@ "pbf": "3.2.1", "peggy": "^1.2.0", "pirates": "^4.0.1", + "piscina": "^3.2.0", "playwright": "^1.17.1", "pngjs": "^3.4.0", "postcss": "^8.4.14", @@ -1242,12 +1261,13 @@ "postcss-scss": "^4.0.4", "prettier": "^2.7.1", "pretty-format": "^27.5.1", + "proxy": "^1.0.2", "q": "^1.5.1", "raw-loader": "^3.1.0", - "react-test-renderer": "^16.14.0", + "react-test-renderer": "^17.0.2", "regenerate": "^1.4.0", "resolve": "^1.22.0", - "rxjs-marbles": "^5.0.6", + "rxjs-marbles": "^7.0.1", "sass-loader": "^10.3.1", "selenium-webdriver": "^4.4.0", "simple-git": "^3.10.0", @@ -1261,6 +1281,7 @@ "superagent": "^3.8.2", "supertest": "^3.1.0", "supports-color": "^7.0.0", + "svgo": "^2.8.0", "tape": "^5.0.1", "tempy": "^0.3.0", "terser": "^5.14.1", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index c0957f7ee2bb8..a9a0377b679dd 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -116,8 +116,6 @@ filegroup( "//packages/core/ui-settings/core-ui-settings-browser-mocks:build", "//packages/core/ui-settings/core-ui-settings-browser:build", "//packages/core/ui-settings/core-ui-settings-common:build", - "//packages/elastic-apm-synthtrace:build", - "//packages/elastic-safer-lodash-set:build", "//packages/home/sample_data_card:build", "//packages/home/sample_data_tab:build", "//packages/home/sample_data_types:build", @@ -127,12 +125,14 @@ filegroup( "//packages/kbn-ambient-ui-types:build", "//packages/kbn-analytics:build", "//packages/kbn-apm-config-loader:build", + "//packages/kbn-apm-synthtrace:build", "//packages/kbn-apm-utils:build", "//packages/kbn-axe-config:build", "//packages/kbn-babel-plugin-synthetic-packages:build", "//packages/kbn-babel-preset:build", "//packages/kbn-bazel-packages:build", "//packages/kbn-bazel-runner:build", + "//packages/kbn-chart-icons:build", "//packages/kbn-ci-stats-core:build", "//packages/kbn-ci-stats-performance-metrics:build", "//packages/kbn-ci-stats-reporter:build", @@ -192,6 +192,7 @@ filegroup( "//packages/kbn-repo-source-classifier-cli:build", "//packages/kbn-repo-source-classifier:build", "//packages/kbn-rule-data-utils:build", + "//packages/kbn-safer-lodash-set:build", "//packages/kbn-securitysolution-autocomplete:build", "//packages/kbn-securitysolution-es-utils:build", "//packages/kbn-securitysolution-hook-utils:build", @@ -209,9 +210,6 @@ filegroup( "//packages/kbn-server-http-tools:build", "//packages/kbn-server-route-repository:build", "//packages/kbn-shared-svg:build", - "//packages/kbn-shared-ux-components:build", - "//packages/kbn-shared-ux-services:build", - "//packages/kbn-shared-ux-storybook:build", "//packages/kbn-shared-ux-utility:build", "//packages/kbn-some-dev-log:build", "//packages/kbn-sort-package-json:build", @@ -257,10 +255,20 @@ filegroup( "//packages/shared-ux/page/kibana_no_data/impl:build", "//packages/shared-ux/page/kibana_no_data/mocks:build", "//packages/shared-ux/page/kibana_no_data/types:build", + "//packages/shared-ux/page/kibana_template/impl:build", + "//packages/shared-ux/page/kibana_template/mocks:build", + "//packages/shared-ux/page/kibana_template/types:build", + "//packages/shared-ux/page/no_data_config/impl:build", + "//packages/shared-ux/page/no_data_config/mocks:build", + "//packages/shared-ux/page/no_data_config/types:build", + "//packages/shared-ux/page/no_data/impl:build", + "//packages/shared-ux/page/no_data/mocks:build", + "//packages/shared-ux/page/no_data/types:build", "//packages/shared-ux/page/solution_nav:build", "//packages/shared-ux/prompt/no_data_views/impl:build", "//packages/shared-ux/prompt/no_data_views/mocks:build", "//packages/shared-ux/prompt/no_data_views/types:build", + "//packages/shared-ux/storybook/config:build", "//packages/shared-ux/storybook/mock:build", "//x-pack/packages/ml/agg_utils:build", "//x-pack/packages/ml/aiops_components:build", @@ -381,18 +389,18 @@ filegroup( "//packages/core/ui-settings/core-ui-settings-browser-mocks:build_types", "//packages/core/ui-settings/core-ui-settings-browser:build_types", "//packages/core/ui-settings/core-ui-settings-common:build_types", - "//packages/elastic-apm-synthtrace:build_types", - "//packages/elastic-safer-lodash-set:build_types", "//packages/home/sample_data_card:build_types", "//packages/home/sample_data_tab:build_types", "//packages/kbn-ace:build_types", "//packages/kbn-alerts:build_types", "//packages/kbn-analytics:build_types", "//packages/kbn-apm-config-loader:build_types", + "//packages/kbn-apm-synthtrace:build_types", "//packages/kbn-apm-utils:build_types", "//packages/kbn-axe-config:build_types", "//packages/kbn-bazel-packages:build_types", "//packages/kbn-bazel-runner:build_types", + "//packages/kbn-chart-icons:build_types", "//packages/kbn-ci-stats-core:build_types", "//packages/kbn-ci-stats-performance-metrics:build_types", "//packages/kbn-ci-stats-reporter:build_types", @@ -447,6 +455,7 @@ filegroup( "//packages/kbn-repo-source-classifier-cli:build_types", "//packages/kbn-repo-source-classifier:build_types", "//packages/kbn-rule-data-utils:build_types", + "//packages/kbn-safer-lodash-set:build_types", "//packages/kbn-securitysolution-autocomplete:build_types", "//packages/kbn-securitysolution-es-utils:build_types", "//packages/kbn-securitysolution-hook-utils:build_types", @@ -464,9 +473,6 @@ filegroup( "//packages/kbn-server-http-tools:build_types", "//packages/kbn-server-route-repository:build_types", "//packages/kbn-shared-svg:build_types", - "//packages/kbn-shared-ux-components:build_types", - "//packages/kbn-shared-ux-services:build_types", - "//packages/kbn-shared-ux-storybook:build_types", "//packages/kbn-shared-ux-utility:build_types", "//packages/kbn-some-dev-log:build_types", "//packages/kbn-sort-package-json:build_types", @@ -501,9 +507,16 @@ filegroup( "//packages/shared-ux/page/analytics_no_data/mocks:build_types", "//packages/shared-ux/page/kibana_no_data/impl:build_types", "//packages/shared-ux/page/kibana_no_data/mocks:build_types", + "//packages/shared-ux/page/kibana_template/impl:build_types", + "//packages/shared-ux/page/kibana_template/mocks:build_types", + "//packages/shared-ux/page/no_data_config/impl:build_types", + "//packages/shared-ux/page/no_data_config/mocks:build_types", + "//packages/shared-ux/page/no_data/impl:build_types", + "//packages/shared-ux/page/no_data/mocks:build_types", "//packages/shared-ux/page/solution_nav:build_types", "//packages/shared-ux/prompt/no_data_views/impl:build_types", "//packages/shared-ux/prompt/no_data_views/mocks:build_types", + "//packages/shared-ux/storybook/config:build_types", "//packages/shared-ux/storybook/mock:build_types", "//x-pack/packages/ml/agg_utils:build_types", "//x-pack/packages/ml/aiops_components:build_types", diff --git a/packages/core/config/core-config-server-internal/BUILD.bazel b/packages/core/config/core-config-server-internal/BUILD.bazel index d2580d6736a76..7bc32e4198ab1 100644 --- a/packages/core/config/core-config-server-internal/BUILD.bazel +++ b/packages/core/config/core-config-server-internal/BUILD.bazel @@ -26,7 +26,7 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", "//packages/kbn-config", "//packages/core/base/core-base-server-internal", "//packages/kbn-config-mocks", @@ -36,7 +36,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-config:npm_module_types", "//packages/kbn-config-mocks:npm_module_types", "//packages/core/base/core-base-server-internal:npm_module_types", diff --git a/packages/core/logging/core-logging-server-internal/BUILD.bazel b/packages/core/logging/core-logging-server-internal/BUILD.bazel index 199e47161d6a0..abed6f741fc39 100644 --- a/packages/core/logging/core-logging-server-internal/BUILD.bazel +++ b/packages/core/logging/core-logging-server-internal/BUILD.bazel @@ -29,7 +29,7 @@ RUNTIME_DEPS = [ "@npm//lodash", "@npm//moment-timezone", "@npm//elastic-apm-node", - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", "//packages/kbn-config-schema", "//packages/kbn-std", ] @@ -41,7 +41,7 @@ TYPES_DEPS = [ "@npm//rxjs", "@npm//@types/moment-timezone", "@npm//elastic-apm-node", - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-logging:npm_module_types", "//packages/kbn-config-schema:npm_module_types", "//packages/core/base/core-base-server-internal:npm_module_types", diff --git a/packages/core/logging/core-logging-server-internal/src/appenders/rewrite/policies/meta/meta_policy.ts b/packages/core/logging/core-logging-server-internal/src/appenders/rewrite/policies/meta/meta_policy.ts index 2618f0ed50587..45e62713980c0 100644 --- a/packages/core/logging/core-logging-server-internal/src/appenders/rewrite/policies/meta/meta_policy.ts +++ b/packages/core/logging/core-logging-server-internal/src/appenders/rewrite/policies/meta/meta_policy.ts @@ -8,7 +8,7 @@ import { schema } from '@kbn/config-schema'; import { LogRecord } from '@kbn/logging'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { has, unset } from 'lodash'; import { assertNever } from '@kbn/std'; import type { MetaRewritePolicyConfig } from '@kbn/core-logging-server'; diff --git a/packages/core/logging/core-logging-server-internal/src/global_context/merge_global_context.ts b/packages/core/logging/core-logging-server-internal/src/global_context/merge_global_context.ts index 64186392caa56..7e794f0731cf5 100644 --- a/packages/core/logging/core-logging-server-internal/src/global_context/merge_global_context.ts +++ b/packages/core/logging/core-logging-server-internal/src/global_context/merge_global_context.ts @@ -7,7 +7,7 @@ */ import { has } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { LogMeta } from '@kbn/logging'; import { GlobalContext } from './types'; diff --git a/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.tsx b/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.tsx index 81ee879615b76..5fdc4439136f9 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.tsx +++ b/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { Fragment } from 'react'; +import React from 'react'; import ReactDOM from 'react-dom'; import { filter } from 'rxjs/operators'; import { Subscription } from 'rxjs'; @@ -72,7 +72,7 @@ export class UserBannerService { } > - + {content.trim()} banners.remove(id!)}> diff --git a/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel index b0d0964c54a96..40aa528d50a98 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel @@ -29,7 +29,7 @@ NPM_MODULE_EXTRA_FILES = [ RUNTIME_DEPS = [ "@npm//lodash", - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", ### test dependencies "//packages/core/http/core-http-browser-mocks", ] @@ -38,7 +38,7 @@ TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", "@npm//lodash", - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/core/base/core-base-browser-internal:npm_module_types", "//packages/core/http/core-http-browser:npm_module_types", "//packages/core/saved-objects/core-saved-objects-common:npm_module_types", diff --git a/packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts b/packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts index 89501c69dcfb5..adda64d8b4ff3 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts +++ b/packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get, has } from 'lodash'; import type { SavedObject as SavedObjectType } from '@kbn/core-saved-objects-common'; import type { diff --git a/packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts b/packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts index 6ed402ccc30c5..b65c476c54ee0 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts +++ b/packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts @@ -6,15 +6,62 @@ * Side Public License, v 1. */ -import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-browser'; -import { SimpleSavedObjectImpl } from '@kbn/core-saved-objects-browser-internal'; +import type { + SavedObjectsClientContract, + SimpleSavedObject, +} from '@kbn/core-saved-objects-api-browser'; import type { SavedObject } from '@kbn/core-saved-objects-common'; +type T = unknown; + +const simpleSavedObjectMockDefaults: Partial> = { + attributes: {}, + _version: '', + id: 'id', + type: 'type', + migrationVersion: {}, + coreMigrationVersion: '8.0.0', + error: undefined, + references: [], + updatedAt: '', + namespaces: undefined, +}; + const createSimpleSavedObjectMock = ( - client: SavedObjectsClientContract, - savedObject: SavedObject -) => new SimpleSavedObjectImpl(client, savedObject); + savedObject: SavedObject +): jest.Mocked> => { + const mock = { + ...simpleSavedObjectMockDefaults, + attributes: savedObject.attributes, + _version: savedObject.version, + id: savedObject.id, + type: savedObject.type, + migrationVersion: savedObject.migrationVersion, + coreMigrationVersion: savedObject.coreMigrationVersion, + error: savedObject.error, + references: savedObject.references, + updatedAt: savedObject.updated_at, + namespaces: savedObject.namespaces, + get: jest.fn(), + set: jest.fn(), + has: jest.fn(), + save: jest.fn(), + delete: jest.fn(), + }; + mock.get.mockImplementation( + (key: string): any => (savedObject.attributes as any)[key] || undefined + ); + mock.set.mockReturnValue((key: string, value: any) => { + (savedObject as any)[key] = value; + return savedObject; + }); + mock.has.mockReturnValue(true); + mock.save.mockImplementation(() => Promise.resolve(mock)); + mock.delete.mockImplementation(() => Promise.resolve({})); + return mock; +}; export const simpleSavedObjectMock = { - create: createSimpleSavedObjectMock, + create: (client: SavedObjectsClientContract, savedObject: SavedObject) => + createSimpleSavedObjectMock(savedObject), }; diff --git a/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel b/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel index 19d2290d18f84..3eb0b8d9184fa 100644 --- a/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel +++ b/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel @@ -27,7 +27,7 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", "//packages/kbn-config", "//packages/kbn-config-mocks", ] @@ -35,7 +35,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-config:npm_module_types", "//packages/kbn-config-mocks:npm_module_types", ] diff --git a/packages/core/test-helpers/core-test-helpers-deprecations-getters/src/deprecations_getters.ts b/packages/core/test-helpers/core-test-helpers-deprecations-getters/src/deprecations_getters.ts index 825649a77ac51..9bdbd9c9b3efa 100644 --- a/packages/core/test-helpers/core-test-helpers-deprecations-getters/src/deprecations_getters.ts +++ b/packages/core/test-helpers/core-test-helpers-deprecations-getters/src/deprecations_getters.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import type { ConfigDeprecationProvider, ConfigDeprecationContext } from '@kbn/config'; import { configDeprecationFactory, applyDeprecations } from '@kbn/config'; import { configDeprecationsMock } from '@kbn/config-mocks'; diff --git a/packages/kbn-apm-config-loader/BUILD.bazel b/packages/kbn-apm-config-loader/BUILD.bazel index 74b7fdfe52a1a..b7d9249c9f587 100644 --- a/packages/kbn-apm-config-loader/BUILD.bazel +++ b/packages/kbn-apm-config-loader/BUILD.bazel @@ -27,14 +27,14 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", "//packages/kbn-utils", "@npm//js-yaml", "@npm//lodash", ] TYPES_DEPS = [ - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-utils:npm_module_types", "@npm//@elastic/apm-rum", "@npm//@types/jest", diff --git a/packages/kbn-apm-config-loader/src/utils/apply_config_overrides.ts b/packages/kbn-apm-config-loader/src/utils/apply_config_overrides.ts index e2ae5a2dce3ba..54993ce0843f9 100644 --- a/packages/kbn-apm-config-loader/src/utils/apply_config_overrides.ts +++ b/packages/kbn-apm-config-loader/src/utils/apply_config_overrides.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { getArgValue } from './read_argv'; /** diff --git a/packages/kbn-apm-config-loader/src/utils/read_config.ts b/packages/kbn-apm-config-loader/src/utils/read_config.ts index 0d6fce88b0532..f41f8e66c7d5b 100644 --- a/packages/kbn-apm-config-loader/src/utils/read_config.ts +++ b/packages/kbn-apm-config-loader/src/utils/read_config.ts @@ -9,7 +9,7 @@ import { readFileSync } from 'fs'; import { safeLoad } from 'js-yaml'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { isPlainObject } from 'lodash'; import { ensureDeepObject } from './ensure_deep_object'; diff --git a/packages/elastic-apm-synthtrace/BUILD.bazel b/packages/kbn-apm-synthtrace/BUILD.bazel similarity index 96% rename from packages/elastic-apm-synthtrace/BUILD.bazel rename to packages/kbn-apm-synthtrace/BUILD.bazel index d0963f43e171b..0e759e33c0ab5 100644 --- a/packages/elastic-apm-synthtrace/BUILD.bazel +++ b/packages/kbn-apm-synthtrace/BUILD.bazel @@ -2,8 +2,8 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_BASE_NAME = "elastic-apm-synthtrace" -PKG_REQUIRE_NAME = "@elastic/apm-synthtrace" +PKG_BASE_NAME = "kbn-apm-synthtrace" +PKG_REQUIRE_NAME = "@kbn/apm-synthtrace" SOURCE_FILES = glob( [ diff --git a/packages/elastic-apm-synthtrace/README.md b/packages/kbn-apm-synthtrace/README.md similarity index 92% rename from packages/elastic-apm-synthtrace/README.md rename to packages/kbn-apm-synthtrace/README.md index 24ce3b055abd0..3afc25fb7e9a8 100644 --- a/packages/elastic-apm-synthtrace/README.md +++ b/packages/kbn-apm-synthtrace/README.md @@ -1,6 +1,6 @@ -# @elastic/apm-synthtrace +# @kbn/apm-synthtrace -`@elastic/apm-synthtrace` is a tool in technical preview to generate synthetic APM data. It is intended to be used for development and testing of the Elastic APM app in Kibana. +`@kbn/apm-synthtrace` is a tool in technical preview to generate synthetic APM data. It is intended to be used for development and testing of the Elastic APM app in Kibana. At a high-level, the module works by modeling APM events/metricsets with [a fluent API](https://en.wikipedia.org/wiki/Fluent_interface). The models can then be serialized and converted to Elasticsearch documents. In the future we might support APM Server as an output as well. @@ -25,7 +25,7 @@ This library can currently be used in two ways: #### Example ```ts -import { service, timerange, toElasticsearchOutput } from '@elastic/apm-synthtrace'; +import { service, timerange, toElasticsearchOutput } from '@kbn/apm-synthtrace'; const instance = service('synth-go', 'production', 'go').instance('instance-a'); @@ -72,14 +72,14 @@ const esEvents = toElasticsearchOutput(traceEvents.concat(metricsets)); #### Generating metricsets -`@elastic/apm-synthtrace` can also automatically generate transaction metrics, span destination metrics and transaction breakdown metrics based on the generated trace events. If we expand on the previous example: +`@kbn/apm-synthtrace` can also automatically generate transaction metrics, span destination metrics and transaction breakdown metrics based on the generated trace events. If we expand on the previous example: ```ts import { getTransactionMetrics, getSpanDestinationMetrics, getBreakdownMetrics, -} from '@elastic/apm-synthtrace'; +} from '@kbn/apm-synthtrace'; const esEvents = toElasticsearchOutput([ ...traceEvents, @@ -91,7 +91,7 @@ const esEvents = toElasticsearchOutput([ ### CLI -Via the CLI, you can run scenarios, either using a fixed time range or continuously generating data. Scenarios are available in [`packages/elastic-apm-synthtrace/src/scenarios/`](https://github.com/elastic/kibana/blob/main/packages/elastic-apm-synthtrace/src/scenarios/). +Via the CLI, you can run scenarios, either using a fixed time range or continuously generating data. Scenarios are available in [`packages/kbn-apm-synthtrace/src/scenarios/`](https://github.com/elastic/kibana/blob/main/packages/kbn-apm-synthtrace/src/scenarios/). For live data ingestion: diff --git a/packages/elastic-apm-synthtrace/bin/synthtrace b/packages/kbn-apm-synthtrace/bin/synthtrace similarity index 100% rename from packages/elastic-apm-synthtrace/bin/synthtrace rename to packages/kbn-apm-synthtrace/bin/synthtrace diff --git a/packages/elastic-apm-synthtrace/jest.config.js b/packages/kbn-apm-synthtrace/jest.config.js similarity index 89% rename from packages/elastic-apm-synthtrace/jest.config.js rename to packages/kbn-apm-synthtrace/jest.config.js index 13d8643c5213c..e89880dc7e8df 100644 --- a/packages/elastic-apm-synthtrace/jest.config.js +++ b/packages/kbn-apm-synthtrace/jest.config.js @@ -9,7 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../..', - roots: ['/packages/elastic-apm-synthtrace'], + roots: ['/packages/kbn-apm-synthtrace'], setupFiles: [], setupFilesAfterEnv: [], }; diff --git a/packages/elastic-apm-synthtrace/package.json b/packages/kbn-apm-synthtrace/package.json similarity index 86% rename from packages/elastic-apm-synthtrace/package.json rename to packages/kbn-apm-synthtrace/package.json index bbfcd496c922b..17d4c9b10b75b 100644 --- a/packages/elastic-apm-synthtrace/package.json +++ b/packages/kbn-apm-synthtrace/package.json @@ -1,5 +1,5 @@ { - "name": "@elastic/apm-synthtrace", + "name": "@kbn/apm-synthtrace", "version": "0.1.0", "description": "Elastic APM trace data generator", "license": "SSPL-1.0 OR Elastic License 2.0", diff --git a/packages/elastic-apm-synthtrace/src/.eslintrc.js b/packages/kbn-apm-synthtrace/src/.eslintrc.js similarity index 100% rename from packages/elastic-apm-synthtrace/src/.eslintrc.js rename to packages/kbn-apm-synthtrace/src/.eslintrc.js diff --git a/packages/elastic-apm-synthtrace/src/cli.ts b/packages/kbn-apm-synthtrace/src/cli.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli.ts rename to packages/kbn-apm-synthtrace/src/cli.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/run_synthtrace.ts b/packages/kbn-apm-synthtrace/src/cli/run_synthtrace.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/run_synthtrace.ts rename to packages/kbn-apm-synthtrace/src/cli/run_synthtrace.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/scenario.ts b/packages/kbn-apm-synthtrace/src/cli/scenario.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/scenario.ts rename to packages/kbn-apm-synthtrace/src/cli/scenario.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/get_common_services.ts b/packages/kbn-apm-synthtrace/src/cli/utils/get_common_services.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/get_common_services.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/get_common_services.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/get_scenario.ts b/packages/kbn-apm-synthtrace/src/cli/utils/get_scenario.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/get_scenario.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/get_scenario.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/interval_to_ms.ts b/packages/kbn-apm-synthtrace/src/cli/utils/interval_to_ms.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/interval_to_ms.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/interval_to_ms.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/parse_run_cli_flags.ts b/packages/kbn-apm-synthtrace/src/cli/utils/parse_run_cli_flags.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/parse_run_cli_flags.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/parse_run_cli_flags.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/start_historical_data_upload.ts b/packages/kbn-apm-synthtrace/src/cli/utils/start_historical_data_upload.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/start_historical_data_upload.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/start_historical_data_upload.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/start_live_data_upload.ts b/packages/kbn-apm-synthtrace/src/cli/utils/start_live_data_upload.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/start_live_data_upload.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/start_live_data_upload.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/synthtrace_worker.ts b/packages/kbn-apm-synthtrace/src/cli/utils/synthtrace_worker.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/synthtrace_worker.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/synthtrace_worker.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/worker.js b/packages/kbn-apm-synthtrace/src/cli/utils/worker.js similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/worker.js rename to packages/kbn-apm-synthtrace/src/cli/utils/worker.js diff --git a/packages/elastic-apm-synthtrace/src/index.ts b/packages/kbn-apm-synthtrace/src/index.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/index.ts rename to packages/kbn-apm-synthtrace/src/index.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/agent_config/agent_config.ts b/packages/kbn-apm-synthtrace/src/lib/agent_config/agent_config.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/agent_config/agent_config.ts rename to packages/kbn-apm-synthtrace/src/lib/agent_config/agent_config.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/agent_config/agent_config_fields.ts b/packages/kbn-apm-synthtrace/src/lib/agent_config/agent_config_fields.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/agent_config/agent_config_fields.ts rename to packages/kbn-apm-synthtrace/src/lib/agent_config/agent_config_fields.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/agent_config/index.ts b/packages/kbn-apm-synthtrace/src/lib/agent_config/index.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/agent_config/index.ts rename to packages/kbn-apm-synthtrace/src/lib/agent_config/index.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/agent_config/observer.ts b/packages/kbn-apm-synthtrace/src/lib/agent_config/observer.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/agent_config/observer.ts rename to packages/kbn-apm-synthtrace/src/lib/agent_config/observer.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/aggregators/service_latency_aggregator.ts b/packages/kbn-apm-synthtrace/src/lib/apm/aggregators/service_latency_aggregator.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/aggregators/service_latency_aggregator.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/aggregators/service_latency_aggregator.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/apm_error.ts b/packages/kbn-apm-synthtrace/src/lib/apm/apm_error.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/apm_error.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/apm_error.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/apm_fields.ts b/packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/apm_fields.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/base_span.ts b/packages/kbn-apm-synthtrace/src/lib/apm/base_span.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/base_span.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/base_span.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/browser.ts b/packages/kbn-apm-synthtrace/src/lib/apm/browser.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/browser.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/browser.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts b/packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_kibana_client.ts b/packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_kibana_client.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_kibana_client.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_kibana_client.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/defaults/get_chrome_user_agent_defaults.ts b/packages/kbn-apm-synthtrace/src/lib/apm/defaults/get_chrome_user_agent_defaults.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/defaults/get_chrome_user_agent_defaults.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/defaults/get_chrome_user_agent_defaults.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/index.ts b/packages/kbn-apm-synthtrace/src/lib/apm/index.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/index.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/index.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/instance.ts b/packages/kbn-apm-synthtrace/src/lib/apm/instance.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/instance.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/instance.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/metricset.ts b/packages/kbn-apm-synthtrace/src/lib/apm/metricset.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/metricset.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/metricset.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/processors/get_breakdown_metrics.ts b/packages/kbn-apm-synthtrace/src/lib/apm/processors/get_breakdown_metrics.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/processors/get_breakdown_metrics.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/processors/get_breakdown_metrics.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/processors/get_span_destination_metrics.ts b/packages/kbn-apm-synthtrace/src/lib/apm/processors/get_span_destination_metrics.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/processors/get_span_destination_metrics.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/processors/get_span_destination_metrics.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/processors/get_transaction_metrics.ts b/packages/kbn-apm-synthtrace/src/lib/apm/processors/get_transaction_metrics.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/processors/get_transaction_metrics.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/processors/get_transaction_metrics.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/rum_span.ts b/packages/kbn-apm-synthtrace/src/lib/apm/rum_span.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/rum_span.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/rum_span.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/rum_transaction.ts b/packages/kbn-apm-synthtrace/src/lib/apm/rum_transaction.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/rum_transaction.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/rum_transaction.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/service.ts b/packages/kbn-apm-synthtrace/src/lib/apm/service.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/service.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/service.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/span.ts b/packages/kbn-apm-synthtrace/src/lib/apm/span.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/span.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/span.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/transaction.ts b/packages/kbn-apm-synthtrace/src/lib/apm/transaction.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/transaction.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/transaction.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/utils/aggregate.ts b/packages/kbn-apm-synthtrace/src/lib/apm/utils/aggregate.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/utils/aggregate.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/utils/aggregate.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/utils/create_picker.ts b/packages/kbn-apm-synthtrace/src/lib/apm/utils/create_picker.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/utils/create_picker.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/utils/create_picker.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/utils/get_apm_write_targets.ts b/packages/kbn-apm-synthtrace/src/lib/apm/utils/get_apm_write_targets.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/utils/get_apm_write_targets.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/utils/get_apm_write_targets.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/entity.ts b/packages/kbn-apm-synthtrace/src/lib/entity.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/entity.ts rename to packages/kbn-apm-synthtrace/src/lib/entity.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/entity_generator.ts b/packages/kbn-apm-synthtrace/src/lib/entity_generator.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/entity_generator.ts rename to packages/kbn-apm-synthtrace/src/lib/entity_generator.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts b/packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts rename to packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/entity_streams.ts b/packages/kbn-apm-synthtrace/src/lib/entity_streams.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/entity_streams.ts rename to packages/kbn-apm-synthtrace/src/lib/entity_streams.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/interval.ts b/packages/kbn-apm-synthtrace/src/lib/interval.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/interval.ts rename to packages/kbn-apm-synthtrace/src/lib/interval.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/serializable.ts b/packages/kbn-apm-synthtrace/src/lib/serializable.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/serializable.ts rename to packages/kbn-apm-synthtrace/src/lib/serializable.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stack_monitoring/cluster.ts b/packages/kbn-apm-synthtrace/src/lib/stack_monitoring/cluster.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stack_monitoring/cluster.ts rename to packages/kbn-apm-synthtrace/src/lib/stack_monitoring/cluster.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stack_monitoring/cluster_stats.ts b/packages/kbn-apm-synthtrace/src/lib/stack_monitoring/cluster_stats.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stack_monitoring/cluster_stats.ts rename to packages/kbn-apm-synthtrace/src/lib/stack_monitoring/cluster_stats.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stack_monitoring/index.ts b/packages/kbn-apm-synthtrace/src/lib/stack_monitoring/index.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stack_monitoring/index.ts rename to packages/kbn-apm-synthtrace/src/lib/stack_monitoring/index.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stack_monitoring/kibana.ts b/packages/kbn-apm-synthtrace/src/lib/stack_monitoring/kibana.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stack_monitoring/kibana.ts rename to packages/kbn-apm-synthtrace/src/lib/stack_monitoring/kibana.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stack_monitoring/kibana_stats.ts b/packages/kbn-apm-synthtrace/src/lib/stack_monitoring/kibana_stats.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stack_monitoring/kibana_stats.ts rename to packages/kbn-apm-synthtrace/src/lib/stack_monitoring/kibana_stats.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stack_monitoring/stack_monitoring_fields.ts b/packages/kbn-apm-synthtrace/src/lib/stack_monitoring/stack_monitoring_fields.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stack_monitoring/stack_monitoring_fields.ts rename to packages/kbn-apm-synthtrace/src/lib/stack_monitoring/stack_monitoring_fields.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stream_aggregator.ts b/packages/kbn-apm-synthtrace/src/lib/stream_aggregator.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stream_aggregator.ts rename to packages/kbn-apm-synthtrace/src/lib/stream_aggregator.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stream_processor.ts b/packages/kbn-apm-synthtrace/src/lib/stream_processor.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stream_processor.ts rename to packages/kbn-apm-synthtrace/src/lib/stream_processor.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/timerange.ts b/packages/kbn-apm-synthtrace/src/lib/timerange.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/timerange.ts rename to packages/kbn-apm-synthtrace/src/lib/timerange.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts b/packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts rename to packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/create_logger.ts b/packages/kbn-apm-synthtrace/src/lib/utils/create_logger.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/utils/create_logger.ts rename to packages/kbn-apm-synthtrace/src/lib/utils/create_logger.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/dedot.ts b/packages/kbn-apm-synthtrace/src/lib/utils/dedot.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/utils/dedot.ts rename to packages/kbn-apm-synthtrace/src/lib/utils/dedot.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/generate_id.ts b/packages/kbn-apm-synthtrace/src/lib/utils/generate_id.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/utils/generate_id.ts rename to packages/kbn-apm-synthtrace/src/lib/utils/generate_id.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/get_synthtrace_environment.ts b/packages/kbn-apm-synthtrace/src/lib/utils/get_synthtrace_environment.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/utils/get_synthtrace_environment.ts rename to packages/kbn-apm-synthtrace/src/lib/utils/get_synthtrace_environment.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/merge_iterable.ts b/packages/kbn-apm-synthtrace/src/lib/utils/merge_iterable.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/utils/merge_iterable.ts rename to packages/kbn-apm-synthtrace/src/lib/utils/merge_iterable.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/agent_config.ts b/packages/kbn-apm-synthtrace/src/scenarios/agent_config.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/agent_config.ts rename to packages/kbn-apm-synthtrace/src/scenarios/agent_config.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/aws_lambda.ts b/packages/kbn-apm-synthtrace/src/scenarios/aws_lambda.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/aws_lambda.ts rename to packages/kbn-apm-synthtrace/src/scenarios/aws_lambda.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/kibana_stats.ts b/packages/kbn-apm-synthtrace/src/scenarios/kibana_stats.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/kibana_stats.ts rename to packages/kbn-apm-synthtrace/src/scenarios/kibana_stats.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/low_throughput.ts b/packages/kbn-apm-synthtrace/src/scenarios/low_throughput.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/low_throughput.ts rename to packages/kbn-apm-synthtrace/src/scenarios/low_throughput.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/many_services.ts b/packages/kbn-apm-synthtrace/src/scenarios/many_services.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/many_services.ts rename to packages/kbn-apm-synthtrace/src/scenarios/many_services.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/monitoring.ts b/packages/kbn-apm-synthtrace/src/scenarios/monitoring.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/monitoring.ts rename to packages/kbn-apm-synthtrace/src/scenarios/monitoring.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/simple_trace.ts b/packages/kbn-apm-synthtrace/src/scenarios/simple_trace.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/simple_trace.ts rename to packages/kbn-apm-synthtrace/src/scenarios/simple_trace.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/span_links.ts b/packages/kbn-apm-synthtrace/src/scenarios/span_links.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/span_links.ts rename to packages/kbn-apm-synthtrace/src/scenarios/span_links.ts diff --git a/packages/elastic-apm-synthtrace/src/test/apm_events_to_elasticsearch_output.test.ts b/packages/kbn-apm-synthtrace/src/test/apm_events_to_elasticsearch_output.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/apm_events_to_elasticsearch_output.test.ts rename to packages/kbn-apm-synthtrace/src/test/apm_events_to_elasticsearch_output.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/event_dsl_behavior.test.ts b/packages/kbn-apm-synthtrace/src/test/event_dsl_behavior.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/event_dsl_behavior.test.ts rename to packages/kbn-apm-synthtrace/src/test/event_dsl_behavior.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/rate_per_minute.test.ts b/packages/kbn-apm-synthtrace/src/test/rate_per_minute.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/rate_per_minute.test.ts rename to packages/kbn-apm-synthtrace/src/test/rate_per_minute.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts rename to packages/kbn-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/02_transaction_metrics.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/02_transaction_metrics.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/02_transaction_metrics.test.ts rename to packages/kbn-apm-synthtrace/src/test/scenarios/02_transaction_metrics.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/03_span_destination_metrics.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/03_span_destination_metrics.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/03_span_destination_metrics.test.ts rename to packages/kbn-apm-synthtrace/src/test/scenarios/03_span_destination_metrics.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/04_breakdown_metrics.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/04_breakdown_metrics.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/04_breakdown_metrics.test.ts rename to packages/kbn-apm-synthtrace/src/test/scenarios/04_breakdown_metrics.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/05_transactions_with_errors.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/05_transactions_with_errors.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/05_transactions_with_errors.test.ts rename to packages/kbn-apm-synthtrace/src/test/scenarios/05_transactions_with_errors.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/06_application_metrics.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/06_application_metrics.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/06_application_metrics.test.ts rename to packages/kbn-apm-synthtrace/src/test/scenarios/06_application_metrics.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap b/packages/kbn-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap rename to packages/kbn-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap diff --git a/packages/elastic-apm-synthtrace/src/test/streams_merge.test.ts b/packages/kbn-apm-synthtrace/src/test/streams_merge.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/streams_merge.test.ts rename to packages/kbn-apm-synthtrace/src/test/streams_merge.test.ts diff --git a/packages/elastic-apm-synthtrace/tsconfig.json b/packages/kbn-apm-synthtrace/tsconfig.json similarity index 100% rename from packages/elastic-apm-synthtrace/tsconfig.json rename to packages/kbn-apm-synthtrace/tsconfig.json diff --git a/packages/kbn-babel-preset/node_preset.js b/packages/kbn-babel-preset/node_preset.js index 295ea5d0d8e8b..8fb06d0c293ba 100644 --- a/packages/kbn-babel-preset/node_preset.js +++ b/packages/kbn-babel-preset/node_preset.js @@ -31,7 +31,7 @@ module.exports = (_, options = {}) => { // Because of that we should use for that value the same version we install // in the package.json in order to have the same polyfills between the environment // and the tests - corejs: '3.21.1', + corejs: '3.23.5', bugfixes: true, ...(options['@babel/preset-env'] || {}), diff --git a/packages/kbn-babel-preset/webpack_preset.js b/packages/kbn-babel-preset/webpack_preset.js index 1f5a840f4f54d..02bc6270a8b00 100644 --- a/packages/kbn-babel-preset/webpack_preset.js +++ b/packages/kbn-babel-preset/webpack_preset.js @@ -18,7 +18,7 @@ module.exports = (_, options = {}) => { modules: false, // Please read the explanation for this // in node_preset.js - corejs: '3.21.1', + corejs: '3.23.5', bugfixes: true, }, ], diff --git a/packages/kbn-shared-ux-services/src/services/http.ts b/packages/kbn-chart-icons/.storybook/main.js similarity index 81% rename from packages/kbn-shared-ux-services/src/services/http.ts rename to packages/kbn-chart-icons/.storybook/main.js index 024222092b7b1..8dc3c5d1518f4 100644 --- a/packages/kbn-shared-ux-services/src/services/http.ts +++ b/packages/kbn-chart-icons/.storybook/main.js @@ -6,6 +6,4 @@ * Side Public License, v 1. */ -export interface SharedUxHttpService { - addBasePath: (url: string) => string; -} +module.exports = require('@kbn/storybook').defaultConfig; diff --git a/packages/kbn-shared-ux-services/BUILD.bazel b/packages/kbn-chart-icons/BUILD.bazel old mode 100755 new mode 100644 similarity index 88% rename from packages/kbn-shared-ux-services/BUILD.bazel rename to packages/kbn-chart-icons/BUILD.bazel index 1ed65b979a3e3..b3afcf893fd2e --- a/packages/kbn-shared-ux-services/BUILD.bazel +++ b/packages/kbn-chart-icons/BUILD.bazel @@ -2,16 +2,17 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_DIRNAME = "kbn-shared-ux-services" -PKG_REQUIRE_NAME = "@kbn/shared-ux-services" +PKG_DIRNAME = "kbn-chart-icons" +PKG_REQUIRE_NAME = "@kbn/chart-icons" SOURCE_FILES = glob( [ "src/**/*.ts", - "src/**/*.tsx", + "src/**/*.tsx" ], exclude = [ "**/*.test.*", + "**/*.stories.*" ], ) @@ -37,8 +38,10 @@ NPM_MODULE_EXTRA_FILES = [ # "@npm//name-of-package" # eg. "@npm//lodash" RUNTIME_DEPS = [ + "//packages/kbn-ui-theme", "@npm//react", - "@npm//rxjs", + "@npm//@elastic/eui", + "@npm//@emotion/css", ] # In this array place dependencies necessary to build the types, which will include the @@ -51,10 +54,12 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ + "//packages/kbn-ui-theme:npm_module_types", "@npm//@types/node", "@npm//@types/jest", "@npm//@types/react", - "@npm//rxjs", + "@npm//@elastic/eui", + "@npm//@emotion/css", ] jsts_transpiler( @@ -70,6 +75,10 @@ jsts_transpiler( build_pkg_name = package_name(), root_input_dir = "src", web = True, + additional_args = [ + "--copy-files", + "--quiet" + ], ) ts_config( diff --git a/packages/kbn-chart-icons/README.md b/packages/kbn-chart-icons/README.md new file mode 100644 index 0000000000000..9e6f13e428e5a --- /dev/null +++ b/packages/kbn-chart-icons/README.md @@ -0,0 +1,5 @@ +# @kbn/chart-icons + +This package contains svg shared assets used in charts + +It can be removes when the [EuiIllustrations](https://github.com/elastic/eui/discussions/5546) initiative is shipped. diff --git a/packages/shared-ux/storybook/mock/jest.config.js b/packages/kbn-chart-icons/jest.config.js similarity index 82% rename from packages/shared-ux/storybook/mock/jest.config.js rename to packages/kbn-chart-icons/jest.config.js index f29327c23ca15..771b3dd8ff9b8 100644 --- a/packages/shared-ux/storybook/mock/jest.config.js +++ b/packages/kbn-chart-icons/jest.config.js @@ -8,6 +8,6 @@ module.exports = { preset: '@kbn/test/jest_node', - rootDir: '../../../..', - roots: ['/packages/shared-ux/storybook/mock'], + rootDir: '../..', + roots: ['/packages/kbn-chart-icons'], }; diff --git a/packages/kbn-shared-ux-services/package.json b/packages/kbn-chart-icons/package.json old mode 100755 new mode 100644 similarity index 81% rename from packages/kbn-shared-ux-services/package.json rename to packages/kbn-chart-icons/package.json index 7d7d999bf6961..c1f5912c1269e --- a/packages/kbn-shared-ux-services/package.json +++ b/packages/kbn-chart-icons/package.json @@ -1,5 +1,5 @@ { - "name": "@kbn/shared-ux-services", + "name": "@kbn/chart-icons", "private": true, "version": "1.0.0", "main": "./target_node/index.js", diff --git a/packages/kbn-chart-icons/src/__stories__/icons.stories.tsx b/packages/kbn-chart-icons/src/__stories__/icons.stories.tsx new file mode 100644 index 0000000000000..a9910001eb923 --- /dev/null +++ b/packages/kbn-chart-icons/src/__stories__/icons.stories.tsx @@ -0,0 +1,221 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { FC, ComponentType } from 'react'; +import { EuiFlexItem, EuiFlexGroup, EuiEmptyPrompt, EuiForm, IconType } from '@elastic/eui'; +import { ComponentStory } from '@storybook/react'; + +import { + IconCircle, + IconTriangle, + EuiIconAxisBottom, + EuiIconAxisLeft, + EuiIconAxisRight, + EuiIconAxisTop, + IconChartArea, + IconChartAreaPercentage, + IconChartAreaStacked, + IconChartBar, + IconChartBarAnnotations, + IconChartBarHorizontal, + IconChartBarHorizontalPercentage, + IconChartBarHorizontalStacked, + IconChartBarPercentage, + IconChartBarReferenceLine, + IconChartBarStacked, + IconChartDatatable, + IconChartDonut, + IconChartLine, + IconChartMetric, + IconChartMixedXy, + IconChartMosaic, + IconChartPie, + IconChartTreemap, + IconChartWaffle, + DropIllustration, + GlobeIllustration, + EuiIconLegend, + IconRegionMap, + IconChartHeatmap, + IconChartHorizontalBullet, + IconChartVerticalBullet, +} from '..'; + +export default { + title: 'Chart Icons', + decorators: [(story: Function) => {story()}], +}; + +const IconsArray: Array<{ + title: string; + Component: ComponentType<{ title: string; titleId: string }>; +}> = [ + { + title: 'EuiIconAxisBottom', + Component: EuiIconAxisBottom, + }, + { + title: 'EuiIconAxisLeft', + Component: EuiIconAxisLeft, + }, + { + title: 'EuiIconAxisRight', + Component: EuiIconAxisRight, + }, + { + title: 'EuiIconAxisTop', + Component: EuiIconAxisTop, + }, + { + title: 'IconChartArea', + Component: IconChartArea, + }, + { + title: 'IconChartAreaPercentage', + Component: IconChartAreaPercentage, + }, + { + title: 'IconChartAreaStacked', + Component: IconChartAreaStacked, + }, + { + title: 'IconChartBar', + Component: IconChartBar, + }, + { + title: 'IconChartBarAnnotations', + Component: IconChartBarAnnotations, + }, + { + title: 'IconChartBarHorizontal', + Component: IconChartBarHorizontal, + }, + { + title: 'IconChartBarHorizontalPercentage', + Component: IconChartBarHorizontalPercentage, + }, + { + title: 'IconChartBarHorizontalStacked', + Component: IconChartBarHorizontalStacked, + }, + { + title: 'IconChartBarPercentage', + Component: IconChartBarPercentage, + }, + { + title: 'IconChartBarReferenceLine', + Component: IconChartBarReferenceLine, + }, + { + title: 'IconChartBarStacked', + Component: IconChartBarStacked, + }, + { + title: 'IconChartDatatable', + Component: IconChartDatatable, + }, + { + title: 'IconChartDonut', + Component: IconChartDonut, + }, + { + title: 'IconChartLine', + Component: IconChartLine, + }, + { + title: 'IconChartMetric', + Component: IconChartMetric, + }, + { + title: 'IconChartMixedXy', + Component: IconChartMixedXy, + }, + { + title: 'IconChartMosaic', + Component: IconChartMosaic, + }, + { + title: 'IconChartPie', + Component: IconChartPie, + }, + { + title: 'IconChartTreemap', + Component: IconChartTreemap, + }, + { + title: 'IconChartWaffle', + Component: IconChartWaffle, + }, + { + title: 'DropIllustration', + Component: DropIllustration, + }, + { + title: 'GlobeIllustration', + Component: GlobeIllustration, + }, + { + title: 'EuiIconLegend', + Component: EuiIconLegend, + }, + { + title: 'IconCircle', + Component: IconCircle, + }, + { + title: 'IconTriangle', + Component: IconTriangle, + }, + { + title: 'IconRegionMap', + Component: IconRegionMap, + }, + { + title: 'IconChartHeatmap', + Component: IconChartHeatmap, + }, + { + title: 'IconChartHorizontalBullet', + Component: IconChartHorizontalBullet, + }, + { + title: 'IconChartVerticalBullet', + Component: IconChartVerticalBullet, + }, +]; + +interface RootComponentProps { + icons: typeof IconsArray; +} + +function RootComponent(props: RootComponentProps) { + return ( + + {props.icons.map((i) => ( + + {i.title}} + titleSize={'s'} + /> + + ))} + + ); +} + +const Template: ComponentStory> = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + icons: IconsArray, +}; diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/circle.tsx b/packages/kbn-chart-icons/src/assets/annotation_icons/circle.tsx similarity index 80% rename from src/plugins/chart_expressions/expression_xy/public/icons/circle.tsx rename to packages/kbn-chart-icons/src/assets/annotation_icons/circle.tsx index 39bbe5cde74de..d3cb3789138f1 100644 --- a/src/plugins/chart_expressions/expression_xy/public/icons/circle.tsx +++ b/packages/kbn-chart-icons/src/assets/annotation_icons/circle.tsx @@ -8,9 +8,10 @@ import React from 'react'; import { EuiIconProps } from '@elastic/eui'; -import classnames from 'classnames'; +import { cx } from '@emotion/css'; +import { noFill } from '../common_styles'; -export const CircleIcon = ({ title, titleId, ...props }: Omit) => ( +export const IconCircle = ({ title, titleId, ...props }: Omit) => ( diff --git a/src/plugins/vis_types/xy/public/config/index.ts b/packages/kbn-chart-icons/src/assets/annotation_icons/index.tsx similarity index 81% rename from src/plugins/vis_types/xy/public/config/index.ts rename to packages/kbn-chart-icons/src/assets/annotation_icons/index.tsx index b00d6aea3d356..a776717cfe3c5 100644 --- a/src/plugins/vis_types/xy/public/config/index.ts +++ b/packages/kbn-chart-icons/src/assets/annotation_icons/index.tsx @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -export { getConfig } from './get_config'; -export { getAggId } from './get_agg_id'; +export { IconCircle } from './circle'; +export { IconTriangle } from './triangle'; diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/triangle.tsx b/packages/kbn-chart-icons/src/assets/annotation_icons/triangle.tsx similarity index 83% rename from src/plugins/chart_expressions/expression_xy/public/icons/triangle.tsx rename to packages/kbn-chart-icons/src/assets/annotation_icons/triangle.tsx index 8ffb8c490d9a4..227dc84335821 100644 --- a/src/plugins/chart_expressions/expression_xy/public/icons/triangle.tsx +++ b/packages/kbn-chart-icons/src/assets/annotation_icons/triangle.tsx @@ -8,9 +8,10 @@ import React from 'react'; import { EuiIconProps } from '@elastic/eui'; -import classnames from 'classnames'; +import { cx } from '@emotion/css'; +import { noFill } from '../common_styles'; -export const TriangleIcon = ({ title, titleId, ...props }: Omit) => ( +export const IconTriangle = ({ title, titleId, ...props }: Omit) => ( ); diff --git a/x-pack/plugins/lens/public/assets/axis_bottom.tsx b/packages/kbn-chart-icons/src/assets/axis_bottom.tsx similarity index 82% rename from x-pack/plugins/lens/public/assets/axis_bottom.tsx rename to packages/kbn-chart-icons/src/assets/axis_bottom.tsx index 309d41bf24221..c2ad925a962de 100644 --- a/x-pack/plugins/lens/public/assets/axis_bottom.tsx +++ b/packages/kbn-chart-icons/src/assets/axis_bottom.tsx @@ -1,11 +1,12 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import * as React from 'react'; +import React from 'react'; export const EuiIconAxisBottom = ({ title, diff --git a/x-pack/plugins/lens/public/assets/axis_left.tsx b/packages/kbn-chart-icons/src/assets/axis_left.tsx similarity index 84% rename from x-pack/plugins/lens/public/assets/axis_left.tsx rename to packages/kbn-chart-icons/src/assets/axis_left.tsx index 9a39a2f43a74d..e4d4361ecfe75 100644 --- a/x-pack/plugins/lens/public/assets/axis_left.tsx +++ b/packages/kbn-chart-icons/src/assets/axis_left.tsx @@ -1,11 +1,12 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import * as React from 'react'; +import React from 'react'; export const EuiIconAxisLeft = ({ title, diff --git a/x-pack/plugins/lens/public/assets/axis_right.tsx b/packages/kbn-chart-icons/src/assets/axis_right.tsx similarity index 84% rename from x-pack/plugins/lens/public/assets/axis_right.tsx rename to packages/kbn-chart-icons/src/assets/axis_right.tsx index 4db6fc06d82fa..8316fbe713388 100644 --- a/x-pack/plugins/lens/public/assets/axis_right.tsx +++ b/packages/kbn-chart-icons/src/assets/axis_right.tsx @@ -1,11 +1,12 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import * as React from 'react'; +import React from 'react'; export const EuiIconAxisRight = ({ title, diff --git a/x-pack/plugins/lens/public/assets/axis_top.tsx b/packages/kbn-chart-icons/src/assets/axis_top.tsx similarity index 92% rename from x-pack/plugins/lens/public/assets/axis_top.tsx rename to packages/kbn-chart-icons/src/assets/axis_top.tsx index 2c3dc0744c068..d78dfcc113aad 100644 --- a/x-pack/plugins/lens/public/assets/axis_top.tsx +++ b/packages/kbn-chart-icons/src/assets/axis_top.tsx @@ -1,11 +1,12 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import * as React from 'react'; +import React from 'react'; export const EuiIconAxisTop = ({ title, diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/area.tsx b/packages/kbn-chart-icons/src/assets/chart_area.tsx similarity index 83% rename from src/plugins/chart_expressions/expression_xy/public/icons/area.tsx rename to packages/kbn-chart-icons/src/assets/chart_area.tsx index 010ffaf1fb7ec..a09a9cab956ad 100644 --- a/src/plugins/chart_expressions/expression_xy/public/icons/area.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_area.tsx @@ -8,8 +8,9 @@ import React from 'react'; import { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const AreaIcon = ({ title, titleId, ...props }: Omit) => ( +export const IconChartArea = ({ title, titleId, ...props }: Omit) => ( {title} : null} ); diff --git a/x-pack/plugins/lens/public/assets/chart_area_percentage.tsx b/packages/kbn-chart-icons/src/assets/chart_area_percentage.tsx similarity index 82% rename from x-pack/plugins/lens/public/assets/chart_area_percentage.tsx rename to packages/kbn-chart-icons/src/assets/chart_area_percentage.tsx index 910d5dc817289..07917b1bcabc2 100644 --- a/x-pack/plugins/lens/public/assets/chart_area_percentage.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_area_percentage.tsx @@ -1,14 +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. + * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartAreaPercentage = ({ +export const IconChartAreaPercentage = ({ title, titleId, ...props @@ -25,11 +27,11 @@ export const LensIconChartAreaPercentage = ({ {title ? {title} : null} ); diff --git a/x-pack/plugins/lens/public/assets/chart_area_stacked.tsx b/packages/kbn-chart-icons/src/assets/chart_area_stacked.tsx similarity index 79% rename from x-pack/plugins/lens/public/assets/chart_area_stacked.tsx rename to packages/kbn-chart-icons/src/assets/chart_area_stacked.tsx index 16e1ff849b609..3bfe3cd92b85b 100644 --- a/x-pack/plugins/lens/public/assets/chart_area_stacked.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_area_stacked.tsx @@ -1,18 +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. + * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartAreaStacked = ({ - title, - titleId, - ...props -}: Omit) => ( +export const IconChartAreaStacked = ({ title, titleId, ...props }: Omit) => ( {title} : null} ); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar.tsx b/packages/kbn-chart-icons/src/assets/chart_bar.tsx similarity index 83% rename from src/plugins/chart_expressions/expression_xy/public/icons/bar.tsx rename to packages/kbn-chart-icons/src/assets/chart_bar.tsx index f134d7871bfde..f33b83fca5362 100644 --- a/src/plugins/chart_expressions/expression_xy/public/icons/bar.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_bar.tsx @@ -8,8 +8,9 @@ import React from 'react'; import { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const BarIcon = ({ title, titleId, ...props }: Omit) => ( +export const IconChartBar = ({ title, titleId, ...props }: Omit) => ( {title ? {title} : null} ); diff --git a/x-pack/plugins/lens/public/assets/chart_bar_annotations.tsx b/packages/kbn-chart-icons/src/assets/chart_bar_annotations.tsx similarity index 73% rename from x-pack/plugins/lens/public/assets/chart_bar_annotations.tsx rename to packages/kbn-chart-icons/src/assets/chart_bar_annotations.tsx index 63fc9023533f6..9472cbc0cd762 100644 --- a/x-pack/plugins/lens/public/assets/chart_bar_annotations.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_bar_annotations.tsx @@ -1,14 +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. + * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartBarAnnotations = ({ +export const IconChartBarAnnotations = ({ title, titleId, ...props @@ -25,11 +27,11 @@ export const LensIconChartBarAnnotations = ({ {title ? {title} : null} diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal.tsx b/packages/kbn-chart-icons/src/assets/chart_bar_horizontal.tsx similarity index 80% rename from src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal.tsx rename to packages/kbn-chart-icons/src/assets/chart_bar_horizontal.tsx index a2fb843cb095d..dc113a8ab4ad9 100644 --- a/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_bar_horizontal.tsx @@ -8,8 +8,13 @@ import React from 'react'; import { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const BarHorizontalIcon = ({ title, titleId, ...props }: Omit) => ( +export const IconChartBarHorizontal = ({ + title, + titleId, + ...props +}: Omit) => ( {title} : null} ); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal_percentage.tsx b/packages/kbn-chart-icons/src/assets/chart_bar_horizontal_percentage.tsx similarity index 87% rename from src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal_percentage.tsx rename to packages/kbn-chart-icons/src/assets/chart_bar_horizontal_percentage.tsx index 6b2bb61a246e1..91e8f2639bfa5 100644 --- a/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal_percentage.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_bar_horizontal_percentage.tsx @@ -8,8 +8,9 @@ import React from 'react'; import { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const BarHorizontalPercentageIcon = ({ +export const IconChartBarHorizontalPercentage = ({ title, titleId, ...props @@ -26,11 +27,11 @@ export const BarHorizontalPercentageIcon = ({ {title ? {title} : null} ); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal_stacked.tsx b/packages/kbn-chart-icons/src/assets/chart_bar_horizontal_stacked.tsx similarity index 87% rename from src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal_stacked.tsx rename to packages/kbn-chart-icons/src/assets/chart_bar_horizontal_stacked.tsx index b399c47d3fc7d..6e5e61e386467 100644 --- a/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal_stacked.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_bar_horizontal_stacked.tsx @@ -8,8 +8,9 @@ import React from 'react'; import { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const BarHorizontalStackedIcon = ({ +export const IconChartBarHorizontalStacked = ({ title, titleId, ...props @@ -26,11 +27,11 @@ export const BarHorizontalStackedIcon = ({ {title ? {title} : null} ); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar_percentage.tsx b/packages/kbn-chart-icons/src/assets/chart_bar_percentage.tsx similarity index 82% rename from src/plugins/chart_expressions/expression_xy/public/icons/bar_percentage.tsx rename to packages/kbn-chart-icons/src/assets/chart_bar_percentage.tsx index 64514cea6c012..82a59ebc9be32 100644 --- a/src/plugins/chart_expressions/expression_xy/public/icons/bar_percentage.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_bar_percentage.tsx @@ -8,8 +8,13 @@ import React from 'react'; import { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const BarPercentageIcon = ({ title, titleId, ...props }: Omit) => ( +export const IconChartBarPercentage = ({ + title, + titleId, + ...props +}: Omit) => ( {title} : null} ); diff --git a/x-pack/plugins/lens/public/assets/chart_bar_reference_line.tsx b/packages/kbn-chart-icons/src/assets/chart_bar_reference_line.tsx similarity index 79% rename from x-pack/plugins/lens/public/assets/chart_bar_reference_line.tsx rename to packages/kbn-chart-icons/src/assets/chart_bar_reference_line.tsx index 447641540a284..d8cca5a3f1192 100644 --- a/x-pack/plugins/lens/public/assets/chart_bar_reference_line.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_bar_reference_line.tsx @@ -1,14 +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. + * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartBarReferenceLine = ({ +export const IconChartBarReferenceLine = ({ title, titleId, ...props @@ -25,16 +27,10 @@ export const LensIconChartBarReferenceLine = ({ {title ? {title} : null} - + ); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar_stacked.tsx b/packages/kbn-chart-icons/src/assets/chart_bar_stacked.tsx similarity index 83% rename from src/plugins/chart_expressions/expression_xy/public/icons/bar_stacked.tsx rename to packages/kbn-chart-icons/src/assets/chart_bar_stacked.tsx index 833f3d0e816e6..933be6d5dea7a 100644 --- a/src/plugins/chart_expressions/expression_xy/public/icons/bar_stacked.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_bar_stacked.tsx @@ -8,8 +8,9 @@ import React from 'react'; import { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const BarStackedIcon = ({ title, titleId, ...props }: Omit) => ( +export const IconChartBarStacked = ({ title, titleId, ...props }: Omit) => ( {title ? {title} : null} ); diff --git a/x-pack/plugins/lens/public/assets/chart_datatable.tsx b/packages/kbn-chart-icons/src/assets/chart_datatable.tsx similarity index 75% rename from x-pack/plugins/lens/public/assets/chart_datatable.tsx rename to packages/kbn-chart-icons/src/assets/chart_datatable.tsx index d6a5cb733e1e1..144d6ddb906f5 100644 --- a/x-pack/plugins/lens/public/assets/chart_datatable.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_datatable.tsx @@ -1,18 +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. + * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartDatatable = ({ - title, - titleId, - ...props -}: Omit) => ( +export const IconChartDatatable = ({ title, titleId, ...props }: Omit) => ( {title} : null} ); diff --git a/x-pack/plugins/lens/public/assets/chart_donut.tsx b/packages/kbn-chart-icons/src/assets/chart_donut.tsx similarity index 71% rename from x-pack/plugins/lens/public/assets/chart_donut.tsx rename to packages/kbn-chart-icons/src/assets/chart_donut.tsx index f2ce65a1f2e19..bd9e3f59e72a1 100644 --- a/x-pack/plugins/lens/public/assets/chart_donut.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_donut.tsx @@ -1,14 +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. + * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartDonut = ({ title, titleId, ...props }: Omit) => ( +export const IconChartDonut = ({ title, titleId, ...props }: Omit) => ( {title} : null} ); diff --git a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_icon.tsx b/packages/kbn-chart-icons/src/assets/chart_heatmap.tsx similarity index 85% rename from src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_icon.tsx rename to packages/kbn-chart-icons/src/assets/chart_heatmap.tsx index 7a49d53222946..0609c7263f202 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_icon.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_heatmap.tsx @@ -8,11 +8,9 @@ import { EuiIconProps } from '@elastic/eui'; import React from 'react'; -import { useCommonChartStyles } from '@kbn/charts-plugin/public'; - -export const HeatmapIcon = ({ title, titleId, ...props }: Omit) => { - const { chartIcon } = useCommonChartStyles(); +import { colors } from './common_styles'; +export const IconChartHeatmap = ({ title, titleId, ...props }: Omit) => { return ( {title ? {title} : null} diff --git a/src/plugins/chart_expressions/expression_gauge/public/components/icons/horizontal_bullet_icon.tsx b/packages/kbn-chart-icons/src/assets/chart_horizontal_bullet.tsx similarity index 80% rename from src/plugins/chart_expressions/expression_gauge/public/components/icons/horizontal_bullet_icon.tsx rename to packages/kbn-chart-icons/src/assets/chart_horizontal_bullet.tsx index 5074f00801109..0765444e857a6 100644 --- a/src/plugins/chart_expressions/expression_gauge/public/components/icons/horizontal_bullet_icon.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_horizontal_bullet.tsx @@ -8,11 +8,13 @@ import React from 'react'; import type { EuiIconProps } from '@elastic/eui'; -import { useCommonChartStyles } from '@kbn/charts-plugin/public'; - -export const HorizontalBulletIcon = ({ title, titleId, ...props }: Omit) => { - const { chartIcon } = useCommonChartStyles(); +import { colors } from './common_styles'; +export const IconChartHorizontalBullet = ({ + title, + titleId, + ...props +}: Omit) => { return ( {title ? {title} : null} diff --git a/x-pack/plugins/lens/public/assets/chart_line.tsx b/packages/kbn-chart-icons/src/assets/chart_line.tsx similarity index 83% rename from x-pack/plugins/lens/public/assets/chart_line.tsx rename to packages/kbn-chart-icons/src/assets/chart_line.tsx index 82df68d8fd43c..afaf31b708621 100644 --- a/x-pack/plugins/lens/public/assets/chart_line.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_line.tsx @@ -1,14 +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. + * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartLine = ({ title, titleId, ...props }: Omit) => ( +export const IconChartLine = ({ title, titleId, ...props }: Omit) => ( {title} : null} ); diff --git a/x-pack/plugins/lens/public/assets/chart_metric.tsx b/packages/kbn-chart-icons/src/assets/chart_metric.tsx similarity index 75% rename from x-pack/plugins/lens/public/assets/chart_metric.tsx rename to packages/kbn-chart-icons/src/assets/chart_metric.tsx index d15be760eec60..4feb162a4607c 100644 --- a/x-pack/plugins/lens/public/assets/chart_metric.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_metric.tsx @@ -1,14 +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. + * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartMetric = ({ title, titleId, ...props }: Omit) => ( +export const IconChartMetric = ({ title, titleId, ...props }: Omit) => ( {title} : null} ); diff --git a/x-pack/plugins/lens/public/assets/chart_mixed_xy.tsx b/packages/kbn-chart-icons/src/assets/chart_mixed_xy.tsx similarity index 84% rename from x-pack/plugins/lens/public/assets/chart_mixed_xy.tsx rename to packages/kbn-chart-icons/src/assets/chart_mixed_xy.tsx index bb213217a9fa9..af86b96852dc9 100644 --- a/x-pack/plugins/lens/public/assets/chart_mixed_xy.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_mixed_xy.tsx @@ -1,14 +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. + * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartMixedXy = ({ title, titleId, ...props }: Omit) => ( +export const IconChartMixedXy = ({ title, titleId, ...props }: Omit) => ( {title} : null} ); diff --git a/x-pack/plugins/lens/public/assets/chart_mosaic.tsx b/packages/kbn-chart-icons/src/assets/chart_mosaic.tsx similarity index 73% rename from x-pack/plugins/lens/public/assets/chart_mosaic.tsx rename to packages/kbn-chart-icons/src/assets/chart_mosaic.tsx index c385f0df1a008..23fe548074d5a 100644 --- a/x-pack/plugins/lens/public/assets/chart_mosaic.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_mosaic.tsx @@ -1,14 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; import type { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartMosaic = ({ title, titleId, ...props }: Omit) => ( +export const IconChartMosaic = ({ title, titleId, ...props }: Omit) => ( {title ? : null} diff --git a/x-pack/plugins/lens/public/assets/chart_pie.tsx b/packages/kbn-chart-icons/src/assets/chart_pie.tsx similarity index 68% rename from x-pack/plugins/lens/public/assets/chart_pie.tsx rename to packages/kbn-chart-icons/src/assets/chart_pie.tsx index 56a18b9d61624..16d59e73603ca 100644 --- a/x-pack/plugins/lens/public/assets/chart_pie.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_pie.tsx @@ -1,14 +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. + * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartPie = ({ title, titleId, ...props }: Omit) => ( +export const IconChartPie = ({ title, titleId, ...props }: Omit) => ( {title} : null} ); diff --git a/x-pack/plugins/lens/public/assets/chart_treemap.tsx b/packages/kbn-chart-icons/src/assets/chart_treemap.tsx similarity index 64% rename from x-pack/plugins/lens/public/assets/chart_treemap.tsx rename to packages/kbn-chart-icons/src/assets/chart_treemap.tsx index c56fdedfebdf7..587682994102a 100644 --- a/x-pack/plugins/lens/public/assets/chart_treemap.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_treemap.tsx @@ -1,14 +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. + * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartTreemap = ({ title, titleId, ...props }: Omit) => ( +export const IconChartTreemap = ({ title, titleId, ...props }: Omit) => ( {title} : null} ); diff --git a/src/plugins/chart_expressions/expression_gauge/public/components/icons/vertical_bullet_icon.tsx b/packages/kbn-chart-icons/src/assets/chart_vertical_bullet.tsx similarity index 77% rename from src/plugins/chart_expressions/expression_gauge/public/components/icons/vertical_bullet_icon.tsx rename to packages/kbn-chart-icons/src/assets/chart_vertical_bullet.tsx index 49a1e2a817cf7..5cf427af7d238 100644 --- a/src/plugins/chart_expressions/expression_gauge/public/components/icons/vertical_bullet_icon.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_vertical_bullet.tsx @@ -8,11 +8,13 @@ import React from 'react'; import type { EuiIconProps } from '@elastic/eui'; -import { useCommonChartStyles } from '@kbn/charts-plugin/public'; - -export const VerticalBulletIcon = ({ title, titleId, ...props }: Omit) => { - const { chartIcon } = useCommonChartStyles(); +import { colors } from './common_styles'; +export const IconChartVerticalBullet = ({ + title, + titleId, + ...props +}: Omit) => { return ( {title ? {title} : null} diff --git a/x-pack/plugins/lens/public/assets/chart_waffle.tsx b/packages/kbn-chart-icons/src/assets/chart_waffle.tsx similarity index 80% rename from x-pack/plugins/lens/public/assets/chart_waffle.tsx rename to packages/kbn-chart-icons/src/assets/chart_waffle.tsx index b9ee0557faea9..aeeca67a1a511 100644 --- a/x-pack/plugins/lens/public/assets/chart_waffle.tsx +++ b/packages/kbn-chart-icons/src/assets/chart_waffle.tsx @@ -1,14 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; import type { EuiIconProps } from '@elastic/eui'; +import { colors } from './common_styles'; -export const LensIconChartWaffle = ({ title, titleId, ...props }: Omit) => ( +export const IconChartWaffle = ({ title, titleId, ...props }: Omit) => ( {title ? : null} diff --git a/packages/kbn-chart-icons/src/assets/common_styles.tsx b/packages/kbn-chart-icons/src/assets/common_styles.tsx new file mode 100644 index 0000000000000..21409b5cb6670 --- /dev/null +++ b/packages/kbn-chart-icons/src/assets/common_styles.tsx @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { css } from '@emotion/css'; +import { euiThemeVars } from '@kbn/ui-theme'; + +export const colors = { + subdued: css` + fill: ${euiThemeVars.euiTextSubduedColor}; + `, + accent: css` + fill: ${euiThemeVars.euiColorVis0}; + `, +}; + +export const noFill = css` + fill: none; +`; diff --git a/x-pack/plugins/lens/public/assets/drop_illustration.tsx b/packages/kbn-chart-icons/src/assets/drop_illustration.tsx similarity index 99% rename from x-pack/plugins/lens/public/assets/drop_illustration.tsx rename to packages/kbn-chart-icons/src/assets/drop_illustration.tsx index acd6d7bf31324..c35d46f48c758 100644 --- a/x-pack/plugins/lens/public/assets/drop_illustration.tsx +++ b/packages/kbn-chart-icons/src/assets/drop_illustration.tsx @@ -1,11 +1,12 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import * as React from 'react'; +import React from 'react'; import { EuiIconProps } from '@elastic/eui'; export const DropIllustration = ({ title, titleId, ...props }: Omit) => ( diff --git a/x-pack/plugins/lens/public/assets/globe_illustration.tsx b/packages/kbn-chart-icons/src/assets/globe_illustration.tsx similarity index 98% rename from x-pack/plugins/lens/public/assets/globe_illustration.tsx rename to packages/kbn-chart-icons/src/assets/globe_illustration.tsx index af2f2c7a48e46..b84d39705f632 100644 --- a/x-pack/plugins/lens/public/assets/globe_illustration.tsx +++ b/packages/kbn-chart-icons/src/assets/globe_illustration.tsx @@ -1,11 +1,12 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import * as React from 'react'; +import React from 'react'; import { EuiIconProps } from '@elastic/eui'; export const GlobeIllustration = ({ title, titleId, ...props }: Omit) => ( diff --git a/packages/kbn-chart-icons/src/assets/index.ts b/packages/kbn-chart-icons/src/assets/index.ts new file mode 100644 index 0000000000000..d3d2f968cdcc5 --- /dev/null +++ b/packages/kbn-chart-icons/src/assets/index.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may 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 { IconCircle, IconTriangle } from './annotation_icons'; + +export { EuiIconAxisBottom } from './axis_bottom'; +export { EuiIconAxisLeft } from './axis_left'; +export { EuiIconAxisRight } from './axis_right'; +export { EuiIconAxisTop } from './axis_top'; + +export { IconChartArea } from './chart_area'; +export { IconChartAreaPercentage } from './chart_area_percentage'; +export { IconChartAreaStacked } from './chart_area_stacked'; +export { IconChartBar } from './chart_bar'; +export { IconChartBarAnnotations } from './chart_bar_annotations'; +export { IconChartBarHorizontal } from './chart_bar_horizontal'; +export { IconChartBarHorizontalPercentage } from './chart_bar_horizontal_percentage'; +export { IconChartBarHorizontalStacked } from './chart_bar_horizontal_stacked'; +export { IconChartBarPercentage } from './chart_bar_percentage'; +export { IconChartBarReferenceLine } from './chart_bar_reference_line'; +export { IconChartBarStacked } from './chart_bar_stacked'; +export { IconChartDatatable } from './chart_datatable'; +export { IconChartDonut } from './chart_donut'; +export { IconChartLine } from './chart_line'; +export { IconChartMetric } from './chart_metric'; +export { IconChartMixedXy } from './chart_mixed_xy'; +export { IconChartMosaic } from './chart_mosaic'; +export { IconChartPie } from './chart_pie'; +export { IconChartTreemap } from './chart_treemap'; +export { IconChartWaffle } from './chart_waffle'; +export { DropIllustration } from './drop_illustration'; +export { GlobeIllustration } from './globe_illustration'; +export { EuiIconLegend } from './legend'; +export { IconRegionMap } from './region_map'; +export { IconChartHeatmap } from './chart_heatmap'; +export { IconChartHorizontalBullet } from './chart_horizontal_bullet'; +export { IconChartVerticalBullet } from './chart_vertical_bullet'; diff --git a/x-pack/plugins/lens/public/assets/legend.tsx b/packages/kbn-chart-icons/src/assets/legend.tsx similarity index 84% rename from x-pack/plugins/lens/public/assets/legend.tsx rename to packages/kbn-chart-icons/src/assets/legend.tsx index cde39b222cdd4..ce1a8ef9dcbc4 100644 --- a/x-pack/plugins/lens/public/assets/legend.tsx +++ b/packages/kbn-chart-icons/src/assets/legend.tsx @@ -1,11 +1,12 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import * as React from 'react'; +import React from 'react'; export const EuiIconLegend = ({ title, titleId, ...props }: { title: string; titleId: string }) => ( {title ? : null} diff --git a/src/plugins/charts/public/static/utils/index.ts b/packages/kbn-chart-icons/src/index.ts similarity index 89% rename from src/plugins/charts/public/static/utils/index.ts rename to packages/kbn-chart-icons/src/index.ts index efb6e72823d73..f279aa93de165 100644 --- a/src/plugins/charts/public/static/utils/index.ts +++ b/packages/kbn-chart-icons/src/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export * from './transform_click_event'; +export * from './assets'; diff --git a/packages/kbn-shared-ux-services/tsconfig.json b/packages/kbn-chart-icons/tsconfig.json old mode 100755 new mode 100644 similarity index 76% rename from packages/kbn-shared-ux-services/tsconfig.json rename to packages/kbn-chart-icons/tsconfig.json index 789c6b3111115..1984d8ed8bbef --- a/packages/kbn-shared-ux-services/tsconfig.json +++ b/packages/kbn-chart-icons/tsconfig.json @@ -6,13 +6,14 @@ "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "stripInternal": false, "types": [ "jest", - "node" - ] + "node", + "react", + "@emotion/css/types" + ], }, "include": [ - "src/**/*" + "src/**/*", ] } diff --git a/packages/kbn-coloring/BUILD.bazel b/packages/kbn-coloring/BUILD.bazel index 4b20561e70c96..f266fe42a904d 100644 --- a/packages/kbn-coloring/BUILD.bazel +++ b/packages/kbn-coloring/BUILD.bazel @@ -41,7 +41,6 @@ NPM_MODULE_EXTRA_FILES = [ RUNTIME_DEPS = [ "//packages/kbn-i18n", "//packages/kbn-i18n-react", - "//packages/kbn-shared-ux-storybook", "//packages/kbn-interpreter", "//packages/kbn-utility-types", "//packages/kbn-shared-ux-utility", @@ -65,7 +64,6 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "//packages/kbn-i18n:npm_module_types", "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-shared-ux-storybook:npm_module_types", "//packages/kbn-interpreter:npm_module_types", "//packages/kbn-utility-types:npm_module_types", "//packages/kbn-shared-ux-utility:npm_module_types", diff --git a/packages/kbn-config/BUILD.bazel b/packages/kbn-config/BUILD.bazel index 13cff50a1a2d7..4eeda0470542c 100644 --- a/packages/kbn-config/BUILD.bazel +++ b/packages/kbn-config/BUILD.bazel @@ -30,7 +30,7 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", "//packages/kbn-config-schema", "//packages/kbn-logging", "//packages/kbn-logging-mocks", @@ -47,7 +47,7 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-config-schema:npm_module_types", "//packages/kbn-logging:npm_module_types", "//packages/kbn-logging-mocks:npm_module_types", diff --git a/packages/kbn-config/src/deprecation/apply_deprecations.ts b/packages/kbn-config/src/deprecation/apply_deprecations.ts index 9b0c409204414..09e8efcdbd011 100644 --- a/packages/kbn-config/src/deprecation/apply_deprecations.ts +++ b/packages/kbn-config/src/deprecation/apply_deprecations.ts @@ -7,7 +7,7 @@ */ import { cloneDeep } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import type { AddConfigDeprecation, ChangedDeprecatedPaths, diff --git a/packages/kbn-config/src/object_to_config_adapter.ts b/packages/kbn-config/src/object_to_config_adapter.ts index 6b68f71ea7399..ce186d7b02c34 100644 --- a/packages/kbn-config/src/object_to_config_adapter.ts +++ b/packages/kbn-config/src/object_to_config_adapter.ts @@ -7,7 +7,7 @@ */ import { cloneDeep, get, has } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { getFlattenedObject } from '@kbn/std'; import { Config, ConfigPath } from '.'; diff --git a/packages/kbn-config/src/raw/read_config.ts b/packages/kbn-config/src/raw/read_config.ts index 307ce4e4a0f95..1c842961838f2 100644 --- a/packages/kbn-config/src/raw/read_config.ts +++ b/packages/kbn-config/src/raw/read_config.ts @@ -9,7 +9,7 @@ import { readFileSync } from 'fs'; import { safeLoad } from 'js-yaml'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { isPlainObject } from 'lodash'; import { ensureDeepObject } from './ensure_deep_object'; diff --git a/packages/kbn-eslint-config/.eslintrc.js b/packages/kbn-eslint-config/.eslintrc.js index 97100635ac0ee..f2b6e93649cdd 100644 --- a/packages/kbn-eslint-config/.eslintrc.js +++ b/packages/kbn-eslint-config/.eslintrc.js @@ -123,6 +123,14 @@ module.exports = { to: '@kbn/kibana-utils-plugin/common', exact: true, }, + { + from: '@elastic/safer-lodash-set', + to: '@kbn/safer-lodash-set', + }, + { + from: '@elastic/apm-synthtrace', + to: '@kbn/apm-synthtrace', + }, ], ], diff --git a/packages/kbn-monaco/BUILD.bazel b/packages/kbn-monaco/BUILD.bazel index a2cf0a1bdd92f..dc3acd1c20997 100644 --- a/packages/kbn-monaco/BUILD.bazel +++ b/packages/kbn-monaco/BUILD.bazel @@ -32,11 +32,11 @@ NPM_MODULE_EXTRA_FILES = [ RUNTIME_DEPS = [ "//packages/kbn-babel-preset", "//packages/kbn-i18n", + "@npm//@babel/runtime", "@npm//antlr4ts", "@npm//babel-loader", "@npm//monaco-editor", "@npm//raw-loader", - "@npm//regenerator-runtime", "@npm//rxjs", ] diff --git a/packages/kbn-monaco/src/painless/worker/painless.worker.ts b/packages/kbn-monaco/src/painless/worker/painless.worker.ts index 1ccde6ff45c72..e03d6b5ed7f34 100644 --- a/packages/kbn-monaco/src/painless/worker/painless.worker.ts +++ b/packages/kbn-monaco/src/painless/worker/painless.worker.ts @@ -9,7 +9,7 @@ // This module is intended to be run inside of a webworker /* eslint-disable @kbn/eslint/module_migration */ -import 'regenerator-runtime/runtime'; +import '@babel/runtime/regenerator'; // @ts-ignore import * as worker from 'monaco-editor/esm/vs/editor/editor.worker'; import { monaco } from '../../monaco_imports'; diff --git a/packages/kbn-monaco/src/xjson/worker/xjson.worker.ts b/packages/kbn-monaco/src/xjson/worker/xjson.worker.ts index df5a91f8b316d..b57514f70fca1 100644 --- a/packages/kbn-monaco/src/xjson/worker/xjson.worker.ts +++ b/packages/kbn-monaco/src/xjson/worker/xjson.worker.ts @@ -9,7 +9,7 @@ // Please note: this module is intended to be run inside of a webworker. /* eslint-disable @kbn/eslint/module_migration */ -import 'regenerator-runtime/runtime'; +import '@babel/runtime/regenerator'; // @ts-ignore import * as worker from 'monaco-editor/esm/vs/editor/editor.worker'; import { XJsonWorker } from './xjson_worker'; diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 2a116d9ab60ed..6c95efdba7330 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -70,7 +70,7 @@ pageLoadAssetSize: visTypeTimeseries: 55203 visTypeVega: 153573 visTypeVislib: 242838 - visTypeXy: 113478 + visTypeXy: 30000 visualizations: 90000 watcher: 43598 runtimeFields: 41752 @@ -119,7 +119,6 @@ pageLoadAssetSize: expressionGauge: 25000 controls: 40000 expressionPartitionVis: 26338 - sharedUX: 16225 savedSearch: 16225 ux: 20784 sessionView: 77750 diff --git a/packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts b/packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts index e83fb083e9868..6c69a935184e6 100644 --- a/packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts +++ b/packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts @@ -261,9 +261,4 @@ const expectFileMatchesSnapshotWithCompression = (filePath: string, snapshotLabe Fs.readFileSync(Path.resolve(MOCK_REPO_DIR, `${filePath}.br`)) ).toString() ).toEqual(raw); - - // Verify the gzip variant matches - expect( - Zlib.gunzipSync(Fs.readFileSync(Path.resolve(MOCK_REPO_DIR, `${filePath}.gz`))).toString() - ).toEqual(raw); }; diff --git a/packages/kbn-optimizer/src/worker/webpack.config.ts b/packages/kbn-optimizer/src/worker/webpack.config.ts index ccc99a8a42671..1b87498496b24 100644 --- a/packages/kbn-optimizer/src/worker/webpack.config.ts +++ b/packages/kbn-optimizer/src/worker/webpack.config.ts @@ -282,12 +282,6 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker: level: 11, }, }), - new CompressionPlugin({ - algorithm: 'gzip', - filename: '[path].gz', - test: /\.(js|css)$/, - cache: false, - }), ], optimization: { diff --git a/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts b/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts index 9df98159c4e4d..10ad022e45a79 100644 --- a/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts +++ b/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts @@ -95,10 +95,8 @@ it('builds a generated plugin into a viable archive', async () => { "kibana/fooTestPlugin/server/types.js", "kibana/fooTestPlugin/target/public/fooTestPlugin.chunk.1.js", "kibana/fooTestPlugin/target/public/fooTestPlugin.chunk.1.js.br", - "kibana/fooTestPlugin/target/public/fooTestPlugin.chunk.1.js.gz", "kibana/fooTestPlugin/target/public/fooTestPlugin.plugin.js", "kibana/fooTestPlugin/target/public/fooTestPlugin.plugin.js.br", - "kibana/fooTestPlugin/target/public/fooTestPlugin.plugin.js.gz", "kibana/fooTestPlugin/translations/ja-JP.json", "kibana/fooTestPlugin/tsconfig.json", ] diff --git a/packages/elastic-safer-lodash-set/.gitignore b/packages/kbn-safer-lodash-set/.gitignore similarity index 100% rename from packages/elastic-safer-lodash-set/.gitignore rename to packages/kbn-safer-lodash-set/.gitignore diff --git a/packages/elastic-safer-lodash-set/.npmignore b/packages/kbn-safer-lodash-set/.npmignore similarity index 100% rename from packages/elastic-safer-lodash-set/.npmignore rename to packages/kbn-safer-lodash-set/.npmignore diff --git a/packages/elastic-safer-lodash-set/BUILD.bazel b/packages/kbn-safer-lodash-set/BUILD.bazel similarity index 92% rename from packages/elastic-safer-lodash-set/BUILD.bazel rename to packages/kbn-safer-lodash-set/BUILD.bazel index 4a1c8b4290f33..893719c822859 100644 --- a/packages/elastic-safer-lodash-set/BUILD.bazel +++ b/packages/kbn-safer-lodash-set/BUILD.bazel @@ -1,7 +1,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") -PKG_BASE_NAME = "elastic-safer-lodash-set" -PKG_REQUIRE_NAME = "@elastic/safer-lodash-set" +PKG_BASE_NAME = "kbn-safer-lodash-set" +PKG_REQUIRE_NAME = "@kbn/safer-lodash-set" SOURCE_FILES = glob( [ diff --git a/packages/elastic-safer-lodash-set/LICENSE b/packages/kbn-safer-lodash-set/LICENSE similarity index 95% rename from packages/elastic-safer-lodash-set/LICENSE rename to packages/kbn-safer-lodash-set/LICENSE index bae69c938a74c..8c34c9393aec7 100644 --- a/packages/elastic-safer-lodash-set/LICENSE +++ b/packages/kbn-safer-lodash-set/LICENSE @@ -31,4 +31,4 @@ individuals. For exact contribution history, see the revision history available at the following locations: - https://github.com/lodash/lodash - https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lodash - - https://github.com/elastic/kibana/tree/main/packages/elastic-safer-lodash-set + - https://github.com/elastic/kibana/tree/main/packages/kbn-safer-lodash-set diff --git a/packages/elastic-safer-lodash-set/README.md b/packages/kbn-safer-lodash-set/README.md similarity index 86% rename from packages/elastic-safer-lodash-set/README.md rename to packages/kbn-safer-lodash-set/README.md index aae17b35ac130..08df12ff01ec3 100644 --- a/packages/elastic-safer-lodash-set/README.md +++ b/packages/kbn-safer-lodash-set/README.md @@ -1,4 +1,4 @@ -# @elastic/safer-lodash-set +# @kbn/safer-lodash-set This module adds protection against prototype pollution to the [`set`] and [`setWith`] functions from [Lodash] and are API compatible with @@ -23,15 +23,15 @@ console.log(object.x[0].y.z); // => 5 The main module exposes two functions, `set` and `setWith`: ```js -const { set, setWith } = require('@elastic/safer-lodash-set'); +const { set, setWith } = require('@kbn/safer-lodash-set'); ``` Besides the main module, it's also possible to require each function individually: ```js -const set = require('@elastic/safer-lodash-set/set'); -const setWith = require('@elastic/safer-lodash-set/setWith'); +const set = require('@kbn/safer-lodash-set/set'); +const setWith = require('@kbn/safer-lodash-set/setWith'); ``` The APIs of these functions are identical to the equivalent Lodash @@ -44,15 +44,15 @@ This module also supports the `lodash/fp` api and hence exposes the following fp compatible functions: ```js -const { set, setWith } = require('@elastic/safer-lodash-set/fp'); +const { set, setWith } = require('@kbn/safer-lodash-set/fp'); ``` Besides the main fp module, it's also possible to require each function individually: ```js -const set = require('@elastic/safer-lodash-set/fp/set'); -const setWith = require('@elastic/safer-lodash-set/fp/setWith'); +const set = require('@kbn/safer-lodash-set/fp/set'); +const setWith = require('@kbn/safer-lodash-set/fp/setWith'); ``` ## Limitations diff --git a/packages/elastic-safer-lodash-set/fp/assoc.d.ts b/packages/kbn-safer-lodash-set/fp/assoc.d.ts similarity index 80% rename from packages/elastic-safer-lodash-set/fp/assoc.d.ts rename to packages/kbn-safer-lodash-set/fp/assoc.d.ts index c04c85f63a870..45e5800a3a33b 100644 --- a/packages/elastic-safer-lodash-set/fp/assoc.d.ts +++ b/packages/kbn-safer-lodash-set/fp/assoc.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { assoc } from '.'; diff --git a/packages/elastic-safer-lodash-set/fp/assoc.js b/packages/kbn-safer-lodash-set/fp/assoc.js similarity index 76% rename from packages/elastic-safer-lodash-set/fp/assoc.js rename to packages/kbn-safer-lodash-set/fp/assoc.js index 851e11690ea35..d6ea0c9c74b77 100644 --- a/packages/elastic-safer-lodash-set/fp/assoc.js +++ b/packages/kbn-safer-lodash-set/fp/assoc.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ module.exports = require('./set'); diff --git a/packages/elastic-safer-lodash-set/fp/assocPath.d.ts b/packages/kbn-safer-lodash-set/fp/assocPath.d.ts similarity index 80% rename from packages/elastic-safer-lodash-set/fp/assocPath.d.ts rename to packages/kbn-safer-lodash-set/fp/assocPath.d.ts index 534128331f142..334c21ca7e707 100644 --- a/packages/elastic-safer-lodash-set/fp/assocPath.d.ts +++ b/packages/kbn-safer-lodash-set/fp/assocPath.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { assocPath } from '.'; diff --git a/packages/elastic-safer-lodash-set/fp/assocPath.js b/packages/kbn-safer-lodash-set/fp/assocPath.js similarity index 76% rename from packages/elastic-safer-lodash-set/fp/assocPath.js rename to packages/kbn-safer-lodash-set/fp/assocPath.js index 851e11690ea35..d6ea0c9c74b77 100644 --- a/packages/elastic-safer-lodash-set/fp/assocPath.js +++ b/packages/kbn-safer-lodash-set/fp/assocPath.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ module.exports = require('./set'); diff --git a/packages/elastic-safer-lodash-set/fp/index.d.ts b/packages/kbn-safer-lodash-set/fp/index.d.ts similarity index 99% rename from packages/elastic-safer-lodash-set/fp/index.d.ts rename to packages/kbn-safer-lodash-set/fp/index.d.ts index fcd7ff01e3cc8..777c7c0df980a 100644 --- a/packages/elastic-safer-lodash-set/fp/index.d.ts +++ b/packages/kbn-safer-lodash-set/fp/index.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import lodash = require('lodash'); diff --git a/packages/elastic-safer-lodash-set/fp/index.js b/packages/kbn-safer-lodash-set/fp/index.js similarity index 81% rename from packages/elastic-safer-lodash-set/fp/index.js rename to packages/kbn-safer-lodash-set/fp/index.js index 7d9cdb099dfd7..aea3e4600d7c6 100644 --- a/packages/elastic-safer-lodash-set/fp/index.js +++ b/packages/kbn-safer-lodash-set/fp/index.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ exports.set = exports.assoc = exports.assocPath = require('./set'); diff --git a/packages/elastic-safer-lodash-set/fp/set.d.ts b/packages/kbn-safer-lodash-set/fp/set.d.ts similarity index 79% rename from packages/elastic-safer-lodash-set/fp/set.d.ts rename to packages/kbn-safer-lodash-set/fp/set.d.ts index b676d271e0556..3e5730bb1ec42 100644 --- a/packages/elastic-safer-lodash-set/fp/set.d.ts +++ b/packages/kbn-safer-lodash-set/fp/set.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { set } from '.'; diff --git a/packages/elastic-safer-lodash-set/fp/set.js b/packages/kbn-safer-lodash-set/fp/set.js similarity index 84% rename from packages/elastic-safer-lodash-set/fp/set.js rename to packages/kbn-safer-lodash-set/fp/set.js index 0fb48694d736d..3a54fcacec959 100644 --- a/packages/elastic-safer-lodash-set/fp/set.js +++ b/packages/kbn-safer-lodash-set/fp/set.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ /*eslint no-var:0 */ diff --git a/packages/elastic-safer-lodash-set/fp/setWith.d.ts b/packages/kbn-safer-lodash-set/fp/setWith.d.ts similarity index 80% rename from packages/elastic-safer-lodash-set/fp/setWith.d.ts rename to packages/kbn-safer-lodash-set/fp/setWith.d.ts index 812437adc165a..20eadd898fa52 100644 --- a/packages/elastic-safer-lodash-set/fp/setWith.d.ts +++ b/packages/kbn-safer-lodash-set/fp/setWith.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { setWith } from '.'; diff --git a/packages/elastic-safer-lodash-set/fp/setWith.js b/packages/kbn-safer-lodash-set/fp/setWith.js similarity index 84% rename from packages/elastic-safer-lodash-set/fp/setWith.js rename to packages/kbn-safer-lodash-set/fp/setWith.js index e477d4b4bc7ba..9842e1ecf93b2 100644 --- a/packages/elastic-safer-lodash-set/fp/setWith.js +++ b/packages/kbn-safer-lodash-set/fp/setWith.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ /*eslint no-var:0 */ diff --git a/packages/elastic-safer-lodash-set/index.d.ts b/packages/kbn-safer-lodash-set/index.d.ts similarity index 96% rename from packages/elastic-safer-lodash-set/index.d.ts rename to packages/kbn-safer-lodash-set/index.d.ts index aaff01f11a7af..198df549e0704 100644 --- a/packages/elastic-safer-lodash-set/index.d.ts +++ b/packages/kbn-safer-lodash-set/index.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ export = SaferLodashSet; diff --git a/packages/elastic-safer-lodash-set/index.js b/packages/kbn-safer-lodash-set/index.js similarity index 80% rename from packages/elastic-safer-lodash-set/index.js rename to packages/kbn-safer-lodash-set/index.js index d9edb25476c12..9ed12a77aa163 100644 --- a/packages/elastic-safer-lodash-set/index.js +++ b/packages/kbn-safer-lodash-set/index.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ exports.set = require('./lodash/set'); diff --git a/packages/elastic-safer-lodash-set/lodash/_baseSet.js b/packages/kbn-safer-lodash-set/lodash/_baseSet.js similarity index 96% rename from packages/elastic-safer-lodash-set/lodash/_baseSet.js rename to packages/kbn-safer-lodash-set/lodash/_baseSet.js index f2ac3351b5afa..be037ecc344b9 100644 --- a/packages/elastic-safer-lodash-set/lodash/_baseSet.js +++ b/packages/kbn-safer-lodash-set/lodash/_baseSet.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ /* eslint-disable one-var,prettier/prettier,no-var,eqeqeq,no-nested-ternary */ diff --git a/packages/elastic-safer-lodash-set/lodash/set.js b/packages/kbn-safer-lodash-set/lodash/set.js similarity index 94% rename from packages/elastic-safer-lodash-set/lodash/set.js rename to packages/kbn-safer-lodash-set/lodash/set.js index e911e853d64fb..aacd1edf0f50f 100644 --- a/packages/elastic-safer-lodash-set/lodash/set.js +++ b/packages/kbn-safer-lodash-set/lodash/set.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ /* eslint-disable no-var */ diff --git a/packages/elastic-safer-lodash-set/lodash/setWith.js b/packages/kbn-safer-lodash-set/lodash/setWith.js similarity index 94% rename from packages/elastic-safer-lodash-set/lodash/setWith.js rename to packages/kbn-safer-lodash-set/lodash/setWith.js index 0295c9ae137d6..2bfd9dd354fde 100644 --- a/packages/elastic-safer-lodash-set/lodash/setWith.js +++ b/packages/kbn-safer-lodash-set/lodash/setWith.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ /* eslint-disable no-var,eqeqeq */ diff --git a/packages/elastic-safer-lodash-set/package.json b/packages/kbn-safer-lodash-set/package.json similarity index 83% rename from packages/elastic-safer-lodash-set/package.json rename to packages/kbn-safer-lodash-set/package.json index 72b908911000d..f850b5fe0fc48 100644 --- a/packages/elastic-safer-lodash-set/package.json +++ b/packages/kbn-safer-lodash-set/package.json @@ -1,11 +1,11 @@ { - "name": "@elastic/safer-lodash-set", + "name": "@kbn/safer-lodash-set", "version": "0.0.0", "description": "A safer version of the lodash set and setWith functions", "main": "index.js", "types": "index.d.ts", "scripts": { - "lint": "../../node_modules/.bin/dependency-check --missing ../../package.json ./packages/elastic-safer-lodash-set/set.js ./packages/elastic-safer-lodash-set/setWith.js ./packages/elastic-safer-lodash-set/fp/*.js", + "lint": "../../node_modules/.bin/dependency-check --missing ../../package.json ./packages/kbn-safer-lodash-set/set.js ./packages/kbn-safer-lodash-set/setWith.js ./packages/kbn-safer-lodash-set/fp/*.js", "test": "npm run lint && ../../node_modules/.bin/tape test/*.js && npm run test:types", "test:types": "../../node_modules/.bin/tsc --noEmit", "update": "./scripts/update.sh", diff --git a/packages/elastic-safer-lodash-set/scripts/_get_lodash.sh b/packages/kbn-safer-lodash-set/scripts/_get_lodash.sh similarity index 82% rename from packages/elastic-safer-lodash-set/scripts/_get_lodash.sh rename to packages/kbn-safer-lodash-set/scripts/_get_lodash.sh index 50d3edaf34717..7fd3a056cf1f9 100755 --- a/packages/elastic-safer-lodash-set/scripts/_get_lodash.sh +++ b/packages/kbn-safer-lodash-set/scripts/_get_lodash.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Elasticsearch B.V licenses this file to you under the MIT License. -# See `packages/elastic-safer-lodash-set/LICENSE` for more information. +# See `packages/kbn-safer-lodash-set/LICENSE` for more information. clean_up () { exit_code=$? diff --git a/packages/elastic-safer-lodash-set/scripts/license-header.txt b/packages/kbn-safer-lodash-set/scripts/license-header.txt similarity index 74% rename from packages/elastic-safer-lodash-set/scripts/license-header.txt rename to packages/kbn-safer-lodash-set/scripts/license-header.txt index 4d0aedf74bb0f..e546841be3a2b 100644 --- a/packages/elastic-safer-lodash-set/scripts/license-header.txt +++ b/packages/kbn-safer-lodash-set/scripts/license-header.txt @@ -2,6 +2,6 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ diff --git a/packages/elastic-safer-lodash-set/scripts/patches/_baseSet.js.patch b/packages/kbn-safer-lodash-set/scripts/patches/_baseSet.js.patch similarity index 93% rename from packages/elastic-safer-lodash-set/scripts/patches/_baseSet.js.patch rename to packages/kbn-safer-lodash-set/scripts/patches/_baseSet.js.patch index c7cf2041355d0..9a1ed2892d0d7 100644 --- a/packages/elastic-safer-lodash-set/scripts/patches/_baseSet.js.patch +++ b/packages/kbn-safer-lodash-set/scripts/patches/_baseSet.js.patch @@ -9,7 +9,7 @@ > * This file is forked from the lodash project (https://lodash.com/), > * and may include modifications made by Elasticsearch B.V. > * Elasticsearch B.V. licenses this file to you under the MIT License. -> * See `packages/elastic-safer-lodash-set/LICENSE` for more information. +> * See `packages/kbn-safer-lodash-set/LICENSE` for more information. > */ > > /* eslint-disable */ diff --git a/packages/elastic-safer-lodash-set/scripts/save_state.sh b/packages/kbn-safer-lodash-set/scripts/save_state.sh similarity index 84% rename from packages/elastic-safer-lodash-set/scripts/save_state.sh rename to packages/kbn-safer-lodash-set/scripts/save_state.sh index ead99c3d1de48..72bca0288f506 100755 --- a/packages/elastic-safer-lodash-set/scripts/save_state.sh +++ b/packages/kbn-safer-lodash-set/scripts/save_state.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Elasticsearch B.V licenses this file to you under the MIT License. -# See `packages/elastic-safer-lodash-set/LICENSE` for more information. +# See `packages/kbn-safer-lodash-set/LICENSE` for more information. set -e diff --git a/packages/elastic-safer-lodash-set/scripts/update.sh b/packages/kbn-safer-lodash-set/scripts/update.sh similarity index 94% rename from packages/elastic-safer-lodash-set/scripts/update.sh rename to packages/kbn-safer-lodash-set/scripts/update.sh index 58fd89eb43e33..e16b03edbe13b 100755 --- a/packages/elastic-safer-lodash-set/scripts/update.sh +++ b/packages/kbn-safer-lodash-set/scripts/update.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Elasticsearch B.V licenses this file to you under the MIT License. -# See `packages/elastic-safer-lodash-set/LICENSE` for more information. +# See `packages/kbn-safer-lodash-set/LICENSE` for more information. set -e diff --git a/packages/elastic-safer-lodash-set/set.d.ts b/packages/kbn-safer-lodash-set/set.d.ts similarity index 79% rename from packages/elastic-safer-lodash-set/set.d.ts rename to packages/kbn-safer-lodash-set/set.d.ts index b676d271e0556..3e5730bb1ec42 100644 --- a/packages/elastic-safer-lodash-set/set.d.ts +++ b/packages/kbn-safer-lodash-set/set.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { set } from '.'; diff --git a/packages/elastic-safer-lodash-set/set.js b/packages/kbn-safer-lodash-set/set.js similarity index 77% rename from packages/elastic-safer-lodash-set/set.js rename to packages/kbn-safer-lodash-set/set.js index 6977062908549..a02607a433efb 100644 --- a/packages/elastic-safer-lodash-set/set.js +++ b/packages/kbn-safer-lodash-set/set.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ module.exports = require('./lodash/set'); diff --git a/packages/elastic-safer-lodash-set/setWith.d.ts b/packages/kbn-safer-lodash-set/setWith.d.ts similarity index 80% rename from packages/elastic-safer-lodash-set/setWith.d.ts rename to packages/kbn-safer-lodash-set/setWith.d.ts index 812437adc165a..20eadd898fa52 100644 --- a/packages/elastic-safer-lodash-set/setWith.d.ts +++ b/packages/kbn-safer-lodash-set/setWith.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { setWith } from '.'; diff --git a/packages/elastic-safer-lodash-set/setWith.js b/packages/kbn-safer-lodash-set/setWith.js similarity index 77% rename from packages/elastic-safer-lodash-set/setWith.js rename to packages/kbn-safer-lodash-set/setWith.js index aafa8a4db4be6..c957b03e349e0 100644 --- a/packages/elastic-safer-lodash-set/setWith.js +++ b/packages/kbn-safer-lodash-set/setWith.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ module.exports = require('./lodash/setWith'); diff --git a/packages/elastic-safer-lodash-set/test/fp.ts b/packages/kbn-safer-lodash-set/test/fp.ts similarity index 98% rename from packages/elastic-safer-lodash-set/test/fp.ts rename to packages/kbn-safer-lodash-set/test/fp.ts index 7a1d6601b5e26..79fda77cbd148 100644 --- a/packages/elastic-safer-lodash-set/test/fp.ts +++ b/packages/kbn-safer-lodash-set/test/fp.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/fp_assoc.ts b/packages/kbn-safer-lodash-set/test/fp_assoc.ts similarity index 92% rename from packages/elastic-safer-lodash-set/test/fp_assoc.ts rename to packages/kbn-safer-lodash-set/test/fp_assoc.ts index 8244458cd1180..edc57bc29e8e6 100644 --- a/packages/elastic-safer-lodash-set/test/fp_assoc.ts +++ b/packages/kbn-safer-lodash-set/test/fp_assoc.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/fp_assocPath.ts b/packages/kbn-safer-lodash-set/test/fp_assocPath.ts similarity index 93% rename from packages/elastic-safer-lodash-set/test/fp_assocPath.ts rename to packages/kbn-safer-lodash-set/test/fp_assocPath.ts index abbfa57eeb963..1dfb667fd6611 100644 --- a/packages/elastic-safer-lodash-set/test/fp_assocPath.ts +++ b/packages/kbn-safer-lodash-set/test/fp_assocPath.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/fp_patch_test.js b/packages/kbn-safer-lodash-set/test/fp_patch_test.js similarity index 99% rename from packages/elastic-safer-lodash-set/test/fp_patch_test.js rename to packages/kbn-safer-lodash-set/test/fp_patch_test.js index 362ecf6f9d866..a7a900bd7601f 100644 --- a/packages/elastic-safer-lodash-set/test/fp_patch_test.js +++ b/packages/kbn-safer-lodash-set/test/fp_patch_test.js @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ const test = require('tape'); diff --git a/packages/elastic-safer-lodash-set/test/fp_set.ts b/packages/kbn-safer-lodash-set/test/fp_set.ts similarity index 92% rename from packages/elastic-safer-lodash-set/test/fp_set.ts rename to packages/kbn-safer-lodash-set/test/fp_set.ts index a5dbb24d33a05..b530314b561d9 100644 --- a/packages/elastic-safer-lodash-set/test/fp_set.ts +++ b/packages/kbn-safer-lodash-set/test/fp_set.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/fp_setWith.ts b/packages/kbn-safer-lodash-set/test/fp_setWith.ts similarity index 96% rename from packages/elastic-safer-lodash-set/test/fp_setWith.ts rename to packages/kbn-safer-lodash-set/test/fp_setWith.ts index 70a5197f72176..c86c9267e07ec 100644 --- a/packages/elastic-safer-lodash-set/test/fp_setWith.ts +++ b/packages/kbn-safer-lodash-set/test/fp_setWith.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/index.ts b/packages/kbn-safer-lodash-set/test/index.ts similarity index 92% rename from packages/elastic-safer-lodash-set/test/index.ts rename to packages/kbn-safer-lodash-set/test/index.ts index 2090c1adcfce1..cbaefb250598c 100644 --- a/packages/elastic-safer-lodash-set/test/index.ts +++ b/packages/kbn-safer-lodash-set/test/index.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/patch_test.js b/packages/kbn-safer-lodash-set/test/patch_test.js similarity index 98% rename from packages/elastic-safer-lodash-set/test/patch_test.js rename to packages/kbn-safer-lodash-set/test/patch_test.js index 80a44eb0c5b6b..f83cbe1e40b85 100644 --- a/packages/elastic-safer-lodash-set/test/patch_test.js +++ b/packages/kbn-safer-lodash-set/test/patch_test.js @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ const test = require('tape'); diff --git a/packages/elastic-safer-lodash-set/test/set.ts b/packages/kbn-safer-lodash-set/test/set.ts similarity index 84% rename from packages/elastic-safer-lodash-set/test/set.ts rename to packages/kbn-safer-lodash-set/test/set.ts index 9829ac3f04ce5..b07bc407d6a8c 100644 --- a/packages/elastic-safer-lodash-set/test/set.ts +++ b/packages/kbn-safer-lodash-set/test/set.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/setWith.ts b/packages/kbn-safer-lodash-set/test/setWith.ts similarity index 91% rename from packages/elastic-safer-lodash-set/test/setWith.ts rename to packages/kbn-safer-lodash-set/test/setWith.ts index b3ed93443c4fb..c61aa2d8ec2b1 100644 --- a/packages/elastic-safer-lodash-set/test/setWith.ts +++ b/packages/kbn-safer-lodash-set/test/setWith.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/tsconfig.json b/packages/kbn-safer-lodash-set/tsconfig.json similarity index 100% rename from packages/elastic-safer-lodash-set/tsconfig.json rename to packages/kbn-safer-lodash-set/tsconfig.json diff --git a/packages/kbn-shared-ux-components/README.mdx b/packages/kbn-shared-ux-components/README.mdx deleted file mode 100644 index f4673a0804f31..0000000000000 --- a/packages/kbn-shared-ux-components/README.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -id: kibSharedUXComponents -slug: /kibana-dev-docs/shared-ux/packages/kbn-shared-ux-components -title: Shared UX Components -description: -date: 2022-03-11 -tags: ['kibana', 'dev', 'sharedUX'] ---- - -> TODO diff --git a/packages/kbn-shared-ux-components/src/index.ts b/packages/kbn-shared-ux-components/src/index.ts deleted file mode 100644 index 9e11d9341fe59..0000000000000 --- a/packages/kbn-shared-ux-components/src/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. - */ - -// TODO: clintandrewhall - NoDataPageProps is a temporary addition until it is split into its own package -export type { KibanaPageTemplateProps, NoDataPageProps } from './page_template'; - -// TODO: clintandrewhall - NoDataConfigPage is a temporary addition until it is split into its own package -export { KibanaPageTemplate, NoDataConfigPage } from './page_template'; diff --git a/packages/kbn-shared-ux-components/src/page_template/assets/kibana_template_no_data_config.png b/packages/kbn-shared-ux-components/src/page_template/assets/kibana_template_no_data_config.png deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/__snapshots__/no_data_config_page.test.tsx.snap b/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/__snapshots__/no_data_config_page.test.tsx.snap deleted file mode 100644 index 047f44e0d319c..0000000000000 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/__snapshots__/no_data_config_page.test.tsx.snap +++ /dev/null @@ -1,31 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`NoDataConfigPage renders 1`] = ` - - - -`; diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_page.tsx b/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_page.tsx deleted file mode 100644 index 724570d4baccd..0000000000000 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_page.tsx +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { useMemo, FunctionComponent } from 'react'; -import useObservable from 'react-use/lib/useObservable'; -import classNames from 'classnames'; - -import { EuiLink, EuiSpacer, EuiText, EuiTextColor } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { KibanaSolutionAvatar } from '@kbn/shared-ux-avatar-solution'; - -import { useSharedUxServices } from '@kbn/shared-ux-services'; -import { NoDataCard, NoDataCardProvider } from '@kbn/shared-ux-card-no-data'; -import { NoDataPageProps } from './types'; - -export const NoDataPage: FunctionComponent = ({ - solution, - logo, - action, - docsLink, - pageTitle, - ...rest -}) => { - const services = useSharedUxServices(); - - // TODO: clintandrewhall - including the `NoDataCardProvider` here is a temporary solution - // to consumers using this context to populate the NoDataPage. This will likely be removed soon, - // when NoDataPage is moved to its own package. - const currentAppId = useObservable(services.application.currentAppId$); - const noDataCardServices = { - currentAppId, - addBasePath: services.http.addBasePath, - canAccessFleet: services.permissions.canAccessFleet, - navigateToUrl: services.application.navigateToUrl, - }; - - const actionKeys = Object.keys(action); - - const actionCard = useMemo(() => { - if (actionKeys.length !== 1) { - return null; - } - const actionKey = actionKeys[0]; - const key = - actionKey === 'elasticAgent' ? 'empty-page-agent-action' : `empty-page-${actionKey}-action`; - return ; - }, [action, actionKeys]); - - const title = - pageTitle || - i18n.translate('sharedUXComponents.noDataPage.welcomeTitle', { - defaultMessage: 'Welcome to Elastic {solution}!', - values: { solution }, - }); - - return ( -
- - - -

{title}

- -

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

-
-
- - {actionCard} -
- ); -}; diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template.stories.tsx b/packages/kbn-shared-ux-components/src/page_template/page_template.stories.tsx deleted file mode 100644 index ae6be1297f018..0000000000000 --- a/packages/kbn-shared-ux-components/src/page_template/page_template.stories.tsx +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiButton, EuiText } from '@elastic/eui'; -import { SolutionNavProps } from '@kbn/shared-ux-page-solution-nav'; - -import { KibanaPageTemplate } from './page_template'; -import mdx from './page_template.mdx'; -import { KibanaPageTemplateProps } from './types'; - -export default { - title: 'Page Template/Page Template', - description: - 'A thin wrapper around `EuiTemplate`. Takes care of styling, empty state and no data config', - parameters: { - docs: { - page: mdx, - }, - }, -}; - -type Params = Pick & { - canBeCollapsed: boolean; -}; - -const noDataConfig = { - solution: 'Kibana', - action: { - elasticAgent: {}, - }, - docsLink: 'http://wwww.docs.elastic.co', -}; - -const items: SolutionNavProps['items'] = [ - { - name: 'Ingest', - id: '1', - items: [ - { - name: 'Ingest Node Pipelines', - id: '1.1', - }, - { - name: 'Logstash Pipelines', - id: '1.2', - }, - { - name: 'Beats Central Management', - id: '1.3', - }, - ], - }, - { - name: 'Data', - id: '2', - items: [ - { - name: 'Index Management', - id: '2.1', - }, - { - name: 'Index Lifecycle Policies', - id: '2.2', - }, - { - name: 'Snapshot and Restore', - id: '2.3', - }, - ], - }, -]; - -const solutionNavBar = { - items, - logo: 'logoKibana', - name: 'Kibana', - action: { elasticAgent: {} }, -}; - -const content = ( - -

- Page Content goes here -

-
-); - -const header = { - iconType: 'logoKibana', - pageTitle: 'Kibana', - description: 'Welcome to Kibana!', - rightSideItems: [Add something, Do something], -}; - -export const WithNoDataConfig = () => { - return ; -}; - -export const WithNoDataConfigAndSolutionNav = () => { - return ; -}; - -export const PureComponent = (params: Params) => { - return ( - - {content} - - ); -}; - -PureComponent.argTypes = { - isEmptyState: { - control: 'boolean', - defaultValue: false, - }, - pageHeader: { - control: 'boolean', - defaultValue: true, - }, - solutionNav: { - control: 'boolean', - defaultValue: true, - }, - canBeCollapsed: { - control: 'boolean', - defaultValue: true, - }, -}; - -PureComponent.parameters = { - layout: 'fullscreen', -}; - -WithNoDataConfig.parameters = { - layout: 'fullscreen', -}; - -WithNoDataConfigAndSolutionNav.parameters = { - layout: 'fullscreen', -}; diff --git a/packages/kbn-shared-ux-services/README.mdx b/packages/kbn-shared-ux-services/README.mdx deleted file mode 100755 index 589aae4cc7ed2..0000000000000 --- a/packages/kbn-shared-ux-services/README.mdx +++ /dev/null @@ -1,203 +0,0 @@ ---- -id: kibSharedUXServices -slug: /kibana-dev-docs/shared-ux/packages/kbn-shared-ux-services -title: Shared UX Services -description: The `@kbn/shared-ux-services` package provides a thin service abstraction for components and solutions created by the Shared UX team. -date: 2022-03-11 -tags: ['kibana', 'dev', 'sharedUX'] ---- - -## About Shared UX Services - -This package contains a set of services that are used by Shared UX components and solutions. This package serves as a thin abstraction layer between Kibana dependencies and the components in Shared UX that use them. It also allows us to "swap out" different implementations of the interfaces for different environments, (e.g. Storybook, Jest, etc). This decouples the components from what could be complicated or heavily-dependent logic that is difficult to mock. - -## Implementations - -Several implementations of these interfaces exist: - -- `@kbn/shared-ux-services/src/services/stub`: A stub implementation free of dependencies, (and functionality). -- `@kbn/shared-ux-services/src/services/mock`: A Jest mock implementation used in `jest` tests. -- `@kbn/shared-ux-storybook/src/services/`: A Storybook implementation used in Storybook decorators and stories. -- `src/plugins/shared_ux/src/services/`: A Kibana implementation used in Kibana plugins. - -Other implementations could easily be written to support other environments. - -## Architecture - -Lots of components require access to the services provided by other plugins. When we identify a routine that relies on these dependencies, we can write a new method and add it to a namespace, (e.g. `platform`, `user`, etc). These namespaces become interfaces of simple methods stored in `@kbn/shared-ux-services`. From there, we can create implementations for each environment we support. - -Suppose we're creating a new service, `SharedUxFooService`: - -```ts -interface SharedUxFooService { - getFoo(): string; - setBar(bar: string): void; - isBaz(): boolean; -} -``` - -Once defined, we create factories to create those services. - -### Creating a `ServiceFactory` - -A `ServiceFactory` is a simple type that describes 1/ what service is being created, and 2/ what parameters are required to create that service for a given environment. - -### Stub and Mock Factories - -Given the service definition above, we can create a `ServiceFactory` for a stubbed service that gives the bare minimum of functionality: - -```ts -/** - * A factory function for creating a stubbed implementation of `SharedUxFooService`. - */ -export type FooServiceFactory = ServiceFactory; - -/** - * A factory function for creating a stubbed implementation of `SharedUxFooService`. - */ -export const fooServiceFactory: FooServiceFactory = () => ({ - getFoo: () => 'foo', - setBar: () => {}, - isBaz: () => false, -}); -``` - -We can also create a mock for Jest: - -```ts -/** - * A factory function for creating a mock implementation of `SharedUxFooService`. - */ -export type FooServiceFactory = ServiceFactory; - -/** - * A factory function for creating a stubbed implementation of `SharedUxFooService`. - */ -export const fooServiceFactory: FooServiceFactory = () => ({ - getFoo: () => jest.fn(), - setBar: () => jest.fn(), - isBaz: () => jest.fn(), -}); -``` - -### Storybook Factories - -Storybook is where we can begin to take advantage of `Parameters` for a given service. Since stories can use controls to provide parameters, we can create a `ServiceFactory` that uses the `Parameters` generic and returns a `SharedUxFooService` that uses their values. - -```ts -import { action } from '@storybook/addon-actions'; - -interface FooServiceStorybookParameters { - foo: string; - baz: boolean; -} - -/** - * A factory function for creating a Storybook implementation of `SharedUxFooService`. - */ -export type FooServiceFactory = ServiceFactory; - -/** - * A factory function for creating a stubbed implementation of `SharedUxFooService`. - */ -export const fooServiceFactory: FooServiceFactory = ({ foo, baz }) => ({ - getFoo: () => foo, - setBar: () => action('setBar'), - isBaz: () => baz, -}); -``` - -A story can then optionally provide values for those parameters as part of its controls. - -```ts -type Params = Pick; - -export const ComponentStory = ({ foo }: Params) => { - const service = fooServiceFactory({ foo, baz: false }); - - return ( - ; -}; - -PureComponent.argTypes = { - foo: { - options: ['alpha', 'beta', 'gamma', 'delta'], - control: { type: 'radio' }, - }, -}; -``` - -### Kibana Factories - -Using these services in Kibana is a bit more complex, but is still relatively simple. First, we define what dependencies we'll need, (we use this interface in `src/plugins/shared_ux` as it relies on types found only in plugins, where packages cannot use them): - -```ts -/** - * Parameters necessary to create a Kibana-based service, (e.g. during Plugin - * startup or setup). - * - * The `Start` generic refers to the specific Plugin `TPluginsStart`. - */ -export interface KibanaPluginServiceParams { - coreStart: CoreStart; - startPlugins: Start; - appUpdater?: BehaviorSubject; - initContext?: PluginInitializerContext; -} - -/** - * A factory function for creating a Kibana-based service. - * - * The `Service` generic determines the shape of the Service being produced. - * The `Start` generic refers to the specific Plugin `TPluginsStart`. - */ -export type KibanaPluginServiceFactory = ( - params: KibanaPluginServiceParams -) => Service; -``` - -From there, a plugin might have a collection of dependencies on core or other plugins: - -```ts -export interface MyPluginStartDeps { - bar: BarPluginStart; - baz: BazPluginStart; -} -``` - -We'd then use this dependency interface to create a `ServiceFactory` for our service in Kibana: - -```ts -export type FooServiceFactory = KibanaPluginServiceFactory< - SharedUxFooService, - MyPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUxFooService`. - */ -export const fooServiceFactory: FooServiceFactory = ({ coreStart, startPlugins }) => ({ - getFoo: startPlugins.bar.getSomeOtherFoo, - setBar: startPlugins.baz.setHappyPathBar, - isBaz: () => { - return coreStart.uiSettings.get('someSetting') === 'expectedValue'; - } -}); -``` - -From there, the pattern is the same: invoke the service factory with the required dependencies and provide them to the `SharedUxServicesContext` Provider: - -```ts - -// plugin.tsx -public start(coreStart: CoreStart, startPlugins: SharedUXPluginStartDeps): SharedUXPluginStart { - const fooService = fooServiceFactory({ coreStart, startPlugins }); - const Context = {children}; - - // ...wrap React content with the context.. -} -``` - -## Use in Kibana plugins - -In order to make consumption of these services easy by Kibana plugins, `src/plugins/shared_ux` provides a pre-wired set of services as part of the `start` lifecycle. Plugins can simply make `sharedUX` a dependency, import `SharedUxServicesProvider` and wrap their solution root (or any component). See the documentation for `sharedUX` for more details. diff --git a/packages/kbn-shared-ux-services/src/context.tsx b/packages/kbn-shared-ux-services/src/context.tsx deleted file mode 100644 index 6131c23e27370..0000000000000 --- a/packages/kbn-shared-ux-services/src/context.tsx +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { FC, createContext, useContext } from 'react'; - -import type { SharedUxServices } from './types'; - -// The React Context used to provide the services to the SharedUX components. -const SharedUxServicesContext = createContext(null); - -/** - * The `React.Context` Provider component for the `SharedUxServices` context. Any - * plugin or environment that consumes SharedUX components needs to wrap their React - * tree with this provider. - * - * Within a plugin, you can use use the Shared UX plugin and retrieve a fully-configured - * context from the `start` contract. - */ -export const SharedUxServicesProvider: FC = ({ children, ...services }) => ( - {children} -); - -/** - * React hook for accessing pre-wired `SharedUxServices`. - */ -export function useSharedUxServices() { - const context = useContext(SharedUxServicesContext); - - if (!context) { - throw new Error( - 'SharedUxServicesContext missing. Ensure your component or React root is wrapped with SharedUxServicesProvider.' - ); - } - - return context; -} - -/** - * React hook for accessing the pre-wired `SharedUxPlatformService`. - */ -export const usePlatformService = () => useSharedUxServices().platform; - -/** - * React hook for accessing the pre-wired `SharedUxPermissionsService`. - */ -export const usePermissions = () => useSharedUxServices().permissions; - -/** - * React hook for accessing the pre-wired `SharedUxEditorsService`. - */ -export const useEditors = () => useSharedUxServices().editors; - -/** - * React hook for accessing the pre-wired `SharedUxDocLinksService`. - */ -export const useDocLinks = () => useSharedUxServices().docLinks; - -export const useHttp = () => useSharedUxServices().http; - -export const useApplication = () => useSharedUxServices().application; - -/** - * React hook for accessing the pre-wired `SharedUxDataService`. - */ -export const useData = () => useSharedUxServices().data; diff --git a/packages/kbn-shared-ux-services/src/index.ts b/packages/kbn-shared-ux-services/src/index.ts deleted file mode 100755 index 47f9d61ff88ac..0000000000000 --- a/packages/kbn-shared-ux-services/src/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export type { ServiceFactory, SharedUxServices, SharedUxServicesContext } from './types'; -export type { - MockServicesFactoryParams, - SharedUxApplicationService, - SharedUxDocLinksService, - SharedUxEditorsService, - SharedUxHttpService, - SharedUxPlatformService, - SharedUxUserPermissionsService, - SharedUxDataService, -} from './services'; - -export { - SharedUxServicesProvider, - useApplication, - useDocLinks, - useEditors, - useHttp, - usePermissions, - usePlatformService, - useData, - useSharedUxServices, -} from './context'; - -export { - mockServiceFactories, - mockServicesFactory, - stubServiceFactories, - stubServicesFactory, -} from './services'; diff --git a/packages/kbn-shared-ux-services/src/services/application.ts b/packages/kbn-shared-ux-services/src/services/application.ts deleted file mode 100644 index 89a7fa91fadc5..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/application.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 { Observable } from 'rxjs'; - -export interface SharedUxApplicationService { - navigateToUrl: (url: string) => Promise | void; - currentAppId$: Observable; -} diff --git a/packages/kbn-shared-ux-services/src/services/data.ts b/packages/kbn-shared-ux-services/src/services/data.ts deleted file mode 100644 index 2750c9bd32085..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/data.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -/** - * A service providing data information. Typically used for handling of empty state.. - */ -export interface SharedUxDataService { - /** True if the cluster contains data, false otherwise. */ - hasESData: () => Promise; - /** True if Kibana instance contains user-created data view, false otherwise. */ - hasUserDataView: () => Promise; - /** True if Kibana instance contains any data view, including system-created ones. */ - hasDataView: () => Promise; -} diff --git a/packages/kbn-shared-ux-services/src/services/doc_links.ts b/packages/kbn-shared-ux-services/src/services/doc_links.ts deleted file mode 100644 index 3b8eb4748d76f..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/doc_links.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. - */ - -/** - * A service providing links to documentation about various features in Kibana. - */ -export interface SharedUxDocLinksService { - /** A link to information about Data Views in Kibana */ - dataViewsDocLink: string; -} diff --git a/packages/kbn-shared-ux-services/src/services/editors.ts b/packages/kbn-shared-ux-services/src/services/editors.ts deleted file mode 100644 index 4dc5b7d9bc269..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/editors.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. - */ - -/** - * TODO: `DataView` is a class exported by `src/plugins/data_views/public`. Since this service - * is contained in this package-- and packages can only depend on other packages and never on - * plugins-- we have to set this to `unknown`. If and when `DataView` is exported from a - * stateless package, we can remove this. - * - * @see: https://github.com/elastic/kibana/issues/127695 - */ -type DataView = unknown; - -/** - * A subset of the `DataViewEditorOptions` interface relevant to our service and components. - * - * @see: src/plugins/data_view_editor/public/types.ts - */ -interface DataViewEditorOptions { - /** Handler to be invoked when the Data View Editor completes a save operation. */ - onSave: (dataView: DataView) => void; -} - -/** - * A service providing methods to invoke and interact with various editors provided - * in Kibana. - */ -export interface SharedUxEditorsService { - /** A method to open the Data View Editor flow. */ - openDataViewEditor: (options: DataViewEditorOptions) => () => void; -} diff --git a/packages/kbn-shared-ux-services/src/services/index.ts b/packages/kbn-shared-ux-services/src/services/index.ts deleted file mode 100644 index 0e4e4e473028d..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export type { SharedUxApplicationService } from './application'; -export type { SharedUxDocLinksService } from './doc_links'; -export type { SharedUxEditorsService } from './editors'; -export type { SharedUxHttpService } from './http'; -export type { SharedUxUserPermissionsService } from './permissions'; -export type { SharedUxPlatformService } from './platform'; -export type { SharedUxDataService } from './data'; -export type { MockServicesFactoryParams } from './mock'; - -// eslint-disable-next-line @kbn/imports/no_boundary_crossing -export { mockServicesFactory, mockServiceFactories } from './mock'; -// eslint-disable-next-line @kbn/imports/no_boundary_crossing -export { stubServicesFactory, stubServiceFactories } from './stub'; diff --git a/packages/kbn-shared-ux-services/src/services/mock/application.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/application.mock.ts deleted file mode 100644 index 947113c4a3168..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/application.mock.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 { Observable } from 'rxjs'; -import { ServiceFactory } from '../../types'; -import { SharedUxApplicationService } from '../application'; - -export type MockApplicationServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Jest-based implementation of `SharedUXApplicationService`. - */ -export const applicationServiceFactory: MockApplicationServiceFactory = () => ({ - navigateToUrl: () => Promise.resolve(), - currentAppId$: new Observable((subscriber) => { - subscriber.next('abc123'); - }), -}); diff --git a/packages/kbn-shared-ux-services/src/services/mock/data.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/data.mock.ts deleted file mode 100644 index bb9d59643348d..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/data.mock.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 { ServiceFactory } from '../../types'; -import { SharedUxDataService } from '../data'; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxDataService`. - */ -export type MockDataServiceFactory = ServiceFactory; - -export interface MockDataServiceFactoryConfig { - hasESData: boolean; - hasDataView: boolean; - hasUserDataView: boolean; -} - -/** - * A factory function for creating a Jest-based implementation of `SharedUxDataService`. - */ -export const dataServiceFactory: (config?: MockDataServiceFactoryConfig) => SharedUxDataService = ( - config?: MockDataServiceFactoryConfig -) => ({ - hasESData: () => Promise.resolve(config?.hasESData || false), - hasDataView: () => Promise.resolve(config?.hasDataView || false), - hasUserDataView: () => Promise.resolve(config?.hasUserDataView || false), -}); diff --git a/packages/kbn-shared-ux-services/src/services/mock/doc_links.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/doc_links.mock.ts deleted file mode 100644 index 2ee0985d0a413..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/doc_links.mock.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. - */ - -import type { ServiceFactory } from '../../types'; -import type { SharedUxDocLinksService } from '../doc_links'; - -/** - * A factory function for creating a Jest implementation of `SharedUxDocLinksService`. - */ -export type MockDocLinksServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxDocLinksService`. - */ -export const docLinksServiceFactory: MockDocLinksServiceFactory = () => ({ - dataViewsDocLink: 'dummy link', -}); diff --git a/packages/kbn-shared-ux-services/src/services/mock/editors.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/editors.mock.ts deleted file mode 100644 index 80742f15d93cd..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/editors.mock.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. - */ - -import type { ServiceFactory } from '../../types'; -import type { SharedUxEditorsService } from '../editors'; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxEditorsService`. - */ -export type MockEditorsServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxEditorsService`. - */ -export const editorsServiceFactory: MockEditorsServiceFactory = () => ({ - openDataViewEditor: jest.fn(), -}); diff --git a/packages/kbn-shared-ux-services/src/services/mock/http.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/http.mock.ts deleted file mode 100644 index 0ef07526e5116..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/http.mock.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { ServiceFactory } from '../../types'; -import { SharedUxHttpService } from '../http'; - -export type MockHttpServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Jest-based implementation of `SharedUXHttpService`. - */ -export const httpServiceFactory: MockHttpServiceFactory = () => ({ - addBasePath: jest.fn((path: string) => (path ? path : 'path')), -}); diff --git a/packages/kbn-shared-ux-services/src/services/mock/index.ts b/packages/kbn-shared-ux-services/src/services/mock/index.ts deleted file mode 100644 index 604a8ae677b9d..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/index.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 type { SharedUxServices } from '../../types'; - -import { applicationServiceFactory } from './application.mock'; -import { docLinksServiceFactory } from './doc_links.mock'; -import { editorsServiceFactory } from './editors.mock'; -import { httpServiceFactory } from './http.mock'; -import { userPermissionsServiceFactory } from './permissions.mock'; -import { platformServiceFactory } from './platform.mock'; -import { dataServiceFactory, MockDataServiceFactoryConfig } from './data.mock'; - -export type { MockApplicationServiceFactory } from './application.mock'; -export type { MockDocLinksServiceFactory } from './doc_links.mock'; -export type { MockEditorsServiceFactory } from './editors.mock'; -export type { MockHttpServiceFactory } from './http.mock'; -export type { MockUserPermissionsServiceFactory } from './permissions.mock'; -export type { MockPlatformServiceFactory } from './platform.mock'; - -export { applicationServiceFactory } from './application.mock'; -export { docLinksServiceFactory } from './doc_links.mock'; -export { editorsServiceFactory } from './editors.mock'; -export { httpServiceFactory } from './http.mock'; -export { userPermissionsServiceFactory } from './permissions.mock'; -export { platformServiceFactory } from './platform.mock'; -export { dataServiceFactory } from './data.mock'; - -export interface MockServicesFactoryParams { - config: MockDataServiceFactoryConfig; -} - -/** - * A factory function for creating a Jest-based implementation of `SharedUxServices`. - */ -export const mockServicesFactory: (params?: MockServicesFactoryParams) => SharedUxServices = ( - params?: MockServicesFactoryParams -) => ({ - application: applicationServiceFactory(), - docLinks: docLinksServiceFactory(), - editors: editorsServiceFactory(), - http: httpServiceFactory(), - permissions: userPermissionsServiceFactory(), - platform: platformServiceFactory(), - data: dataServiceFactory(params?.config), -}); - -/** - * A collection of mock Service Factories. - */ -export const mockServiceFactories = { - applicationServiceFactory, - docLinksServiceFactory, - editorsServiceFactory, - httpServiceFactory, - platformServiceFactory, - userPermissionsServiceFactory, - dataServiceFactory, -}; diff --git a/packages/kbn-shared-ux-services/src/services/mock/permissions.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/permissions.mock.ts deleted file mode 100644 index 3fb5e78a5b839..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/permissions.mock.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 type { ServiceFactory } from '../../types'; -import type { SharedUxUserPermissionsService } from '../permissions'; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxUserPermissionsService`. - */ -export type MockUserPermissionsServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxUserPermissionsService`. - */ -export const userPermissionsServiceFactory: MockUserPermissionsServiceFactory = () => ({ - canCreateNewDataView: true, - canAccessFleet: true, -}); diff --git a/packages/kbn-shared-ux-services/src/services/mock/platform.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/platform.mock.ts deleted file mode 100644 index 8e6ec205d2856..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/platform.mock.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. - */ - -import type { ServiceFactory } from '../../types'; -import type { SharedUxPlatformService } from '../platform'; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxPlatformService`. - */ -export type MockPlatformServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxPlatformService`. - */ -export const platformServiceFactory: MockPlatformServiceFactory = () => ({ - setIsFullscreen: jest.fn(), -}); diff --git a/packages/kbn-shared-ux-services/src/services/permissions.ts b/packages/kbn-shared-ux-services/src/services/permissions.ts deleted file mode 100644 index d6fcabd8ccedf..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/permissions.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. - */ - -/** - * A service providing permissions information, typically for the current user. - */ -export interface SharedUxUserPermissionsService { - /** True if the user has permission to create a new Data View, false otherwise. */ - canCreateNewDataView: boolean; - canAccessFleet: boolean; -} diff --git a/packages/kbn-shared-ux-services/src/services/platform.ts b/packages/kbn-shared-ux-services/src/services/platform.ts deleted file mode 100644 index 83148abac8643..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/platform.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. - */ - -/** - * A service providing methods to interact with the platform in which this code is - * running, (almost always Kibana). - * - * Rather than provide the entire `CoreStart` contract to components, we provide simplified - * abstractions around a use case specific to Shared UX. This way, we know exactly how the - * `CoreStart` and other plugins are used. This makes mocking and refactoring easier when - * upstream dependencies change. - */ -export interface SharedUxPlatformService { - /** - * Sets the fullscreen state of the chrome. - * @param isFullscreen True if the chrome should be fullscreen, false otherwise. - */ - setIsFullscreen: (isFullscreen: boolean) => void; -} diff --git a/packages/kbn-shared-ux-services/src/services/stub/application.ts b/packages/kbn-shared-ux-services/src/services/stub/application.ts deleted file mode 100644 index 72c1f3db30089..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/application.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Observable } from 'rxjs'; -import { ServiceFactory } from '../../types'; -import { SharedUxApplicationService } from '../application'; - -export type ApplicationServiceFactory = ServiceFactory; - -/** - * A factory function for creating for creating a simple stubbed implementation of `SharedUXApplicationService`. - */ -export const applicationServiceFactory: ApplicationServiceFactory = () => ({ - navigateToUrl: (url) => { - // eslint-disable-next-line no-console - console.log(url); - return Promise.resolve(); - }, - currentAppId$: new Observable((subscriber) => { - subscriber.next('123'); - }), -}); diff --git a/packages/kbn-shared-ux-services/src/services/stub/data.ts b/packages/kbn-shared-ux-services/src/services/stub/data.ts deleted file mode 100644 index 833c64e1f9d8d..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/data.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 { ServiceFactory } from '../../types'; -import { SharedUxDataService } from '../data'; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxDataSevice`. - */ -export type DataServiceFactory = ServiceFactory; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxDataSevice`. - */ -export const dataServiceFactory: DataServiceFactory = () => ({ - hasESData: () => Promise.resolve(true), - hasDataView: () => Promise.resolve(false), - hasUserDataView: () => Promise.resolve(false), -}); diff --git a/packages/kbn-shared-ux-services/src/services/stub/doc_links.ts b/packages/kbn-shared-ux-services/src/services/stub/doc_links.ts deleted file mode 100644 index 9bcfd7db78cfa..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/doc_links.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. - */ - -import type { ServiceFactory } from '../../types'; -import type { SharedUxDocLinksService } from '../doc_links'; - -/** - * A factory function for creating a stubbed implementation of `SharedUxDocLinksService`. - */ -export type DocLinksServiceFactory = ServiceFactory; - -/** - * A factory function for creating a stubbed implementation of `SharedUxDocLinksService`. - */ -export const docLinksServiceFactory: DocLinksServiceFactory = () => ({ - dataViewsDocLink: 'docs', -}); diff --git a/packages/kbn-shared-ux-services/src/services/stub/editors.ts b/packages/kbn-shared-ux-services/src/services/stub/editors.ts deleted file mode 100644 index 545539d873941..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/editors.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. - */ - -import type { ServiceFactory } from '../../types'; -import type { SharedUxEditorsService } from '../editors'; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxEditorsService`. - */ -export type EditorsServiceFactory = ServiceFactory; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxEditorsService`. - */ -export const editorsServiceFactory: EditorsServiceFactory = () => ({ - openDataViewEditor: () => () => {}, -}); diff --git a/packages/kbn-shared-ux-services/src/services/stub/http.ts b/packages/kbn-shared-ux-services/src/services/stub/http.ts deleted file mode 100644 index 08dae62ecdb7f..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/http.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 { ServiceFactory } from '../../types'; -import { SharedUxHttpService } from '../http'; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUXHttpService`. - */ -export type HttpServiceFactory = ServiceFactory; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUXHttpService`. - */ -export const httpServiceFactory: HttpServiceFactory = () => ({ - addBasePath: (url: string) => { - return url; - }, -}); diff --git a/packages/kbn-shared-ux-services/src/services/stub/index.ts b/packages/kbn-shared-ux-services/src/services/stub/index.ts deleted file mode 100644 index ab8b0ca3f4d9c..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/index.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import type { SharedUxServices, ServiceFactory } from '../../types'; - -import { applicationServiceFactory } from './application'; -import { docLinksServiceFactory } from './doc_links'; -import { editorsServiceFactory } from './editors'; -import { httpServiceFactory } from './http'; -import { platformServiceFactory } from './platform'; -import { userPermissionsServiceFactory } from './permissions'; -import { dataServiceFactory } from './data'; - -/** - * A factory function for creating simple stubbed implementations of all `SharedUxServices`. - */ -export const stubServicesFactory: ServiceFactory = () => ({ - application: applicationServiceFactory(), - docLinks: docLinksServiceFactory(), - editors: editorsServiceFactory(), - http: httpServiceFactory(), - permissions: userPermissionsServiceFactory(), - platform: platformServiceFactory(), - data: dataServiceFactory(), -}); - -/** - * A collection of stubbed service factories. - */ -export const stubServiceFactories = { - applicationServiceFactory, - docLinksServiceFactory, - editorsServiceFactory, - httpServiceFactory, - platformServiceFactory, - userPermissionsServiceFactory, - dataServiceFactory, -}; diff --git a/packages/kbn-shared-ux-services/src/services/stub/permissions.ts b/packages/kbn-shared-ux-services/src/services/stub/permissions.ts deleted file mode 100644 index e5588f818f82a..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/permissions.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 type { ServiceFactory } from '../../types'; -import type { SharedUxUserPermissionsService } from '../permissions'; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxUserPermissionsService`. - */ -export type UserPermissionsServiceFactory = ServiceFactory; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxUserPermissionsService`. - */ -export const userPermissionsServiceFactory: UserPermissionsServiceFactory = () => ({ - canCreateNewDataView: true, - canAccessFleet: true, -}); diff --git a/packages/kbn-shared-ux-services/src/services/stub/platform.ts b/packages/kbn-shared-ux-services/src/services/stub/platform.ts deleted file mode 100644 index 2e31238347307..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/platform.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. - */ - -import type { ServiceFactory } from '../../types'; -import type { SharedUxPlatformService } from '../platform'; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxPlatformService`. - */ -export type PlatformServiceFactory = ServiceFactory; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxPlatformService`. - */ -export const platformServiceFactory: PlatformServiceFactory = () => ({ - setIsFullscreen: (_isFullscreen) => {}, -}); diff --git a/packages/kbn-shared-ux-services/src/types.ts b/packages/kbn-shared-ux-services/src/types.ts deleted file mode 100755 index a0a4ec32c0e75..0000000000000 --- a/packages/kbn-shared-ux-services/src/types.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { FC } from 'react'; - -import { - SharedUxApplicationService, - SharedUxDataService, - SharedUxDocLinksService, - SharedUxEditorsService, - SharedUxHttpService, - SharedUxPlatformService, - SharedUxUserPermissionsService, -} from './services'; - -/** - * A collection of services utilized by SharedUX. This serves as a thin - * abstraction layer between services provided by Kibana and other plugins - * while allowing this plugin to be developed independently of those contracts. - * - * It also allows us to "swap out" differenct implementations of these services - * for different environments, (e.g. Jest, Storybook, etc.) - */ -export interface SharedUxServices { - application: SharedUxApplicationService; - docLinks: SharedUxDocLinksService; - editors: SharedUxEditorsService; - http: SharedUxHttpService; - permissions: SharedUxUserPermissionsService; - platform: SharedUxPlatformService; - data: SharedUxDataService; -} - -/** - * A type representing a component that provides the `SharedUxServices` through a - * React Context. - */ -export type SharedUxServicesContext = FC<{}>; - -/** - * A factory function for creating one or more services. - * - * The `S` generic determines the shape of the API being produced. - * The `Parameters` generic determines what parameters are expected to - * create the service. - */ -export type ServiceFactory = (params: Parameters) => S; diff --git a/packages/kbn-shared-ux-storybook/README.mdx b/packages/kbn-shared-ux-storybook/README.mdx deleted file mode 100644 index 11992e336e627..0000000000000 --- a/packages/kbn-shared-ux-storybook/README.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -id: kibSharedUXStorybook -slug: /kibana-dev-docs/shared-ux/packages/kbn-shared-ux-storybook -title: Shared UX Storybook -description: The `@kbn/shared-ux-storybook` package provides Storybook assets for Shared UX and other teams. -date: 2022-03-11 -tags: ['kibana', 'dev', 'sharedUX'] ---- - -## About Shared UX Storybook - -This package provides the Storybook implementation of `@kbn/shared-ux-services` as well as the configuration for the Shared UX Storybook site. - -- `/src/services` The `@kbn/shared-ux-services` implementation. -- `src/config` The Storybook site configuration. - -## Storybook site - -Run `yarn storybook shared_ux` from `/kibana` to view the site. It pulls in `*.stories.tsx` from all Shared UX packages and plugins and combines them into a single configuration. - -## Decorator - -If you're writing stories for your own components that compose Shared UX components, you can use a pre-configured [Storybook Decorator](https://storybook.js.org/docs/react/writing-stories/decorators) in your Storybook configuration: - -```ts -// preview.ts - -import { addDecorator } from '@storybook/react'; -import { servicesDecorator } from '@kbn/shared-ux-storybook'; - -addDecorator(servicesDecorator); -``` - -This will not only expose parameters, but also wrap your story in a pre-wired `SharedUxServicesProvider`. \ No newline at end of file diff --git a/packages/kbn-shared-ux-storybook/src/config/preview.ts b/packages/kbn-shared-ux-storybook/src/config/preview.ts deleted file mode 100644 index 194a16474af2c..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/config/preview.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 { addDecorator } from '@storybook/react'; -import { servicesDecorator } from '../decorators'; - -addDecorator(servicesDecorator); diff --git a/packages/kbn-shared-ux-storybook/src/decorators.tsx b/packages/kbn-shared-ux-storybook/src/decorators.tsx deleted file mode 100644 index cae87a15b54dd..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/decorators.tsx +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { DecoratorFn } from '@storybook/react'; - -import { SharedUxServicesProvider } from '@kbn/shared-ux-services'; - -import { servicesFactory } from './services'; - -/** - * A Storybook decorator that provides the Shared UX `ServicesProvider` with Storybook-specific - * implementations to stories. - */ -export const servicesDecorator: DecoratorFn = (storyFn) => ( - {storyFn()} -); diff --git a/packages/kbn-shared-ux-storybook/src/index.ts b/packages/kbn-shared-ux-storybook/src/index.ts deleted file mode 100755 index 6b310673eb00d..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/index.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 { servicesDecorator } from './decorators'; - -export { - applicationServiceFactory, - docLinksServiceFactory, - editorsServiceFactory, - httpServiceFactory, - platformServiceFactory, - servicesFactory, - userPermissionsServiceFactory, - dataServiceFactory, -} from './services'; - -export type { DataServiceFactoryConfig } from './services'; diff --git a/packages/kbn-shared-ux-storybook/src/services/application.ts b/packages/kbn-shared-ux-storybook/src/services/application.ts deleted file mode 100644 index 1b16526bc8be8..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/application.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 { BehaviorSubject } from 'rxjs'; -import { action } from '@storybook/addon-actions'; -import { ServiceFactory, SharedUxApplicationService } from '@kbn/shared-ux-services'; - -export type ApplicationServiceFactory = ServiceFactory; - -/** - * A factory function for creating for creating a storybook implementation of `SharedUXApplicationService`. - */ -export const applicationServiceFactory: ApplicationServiceFactory = () => ({ - navigateToUrl: (url) => { - action('navigateToUrl')(url); - return Promise.resolve(); - }, - currentAppId$: new BehaviorSubject('123'), -}); diff --git a/packages/kbn-shared-ux-storybook/src/services/data.ts b/packages/kbn-shared-ux-storybook/src/services/data.ts deleted file mode 100644 index dbfd2fceb4210..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/data.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 { ServiceFactory, SharedUxDataService } from '@kbn/shared-ux-services'; - -export interface DataServiceFactoryConfig { - hasESData: boolean; - hasDataView: boolean; - hasUserDataView: boolean; -} - -/** - * A factory function for creating a Storybook implementation of `SharedUxDataService`. - */ -export type SharedUxDataServiceFactory = ServiceFactory< - SharedUxDataService, - DataServiceFactoryConfig ->; - -/** - * A factory function for creating a Storybook implementation of `SharedUxDataService`. - */ -export const dataServiceFactory: SharedUxDataServiceFactory = (params) => { - return { - hasESData: () => Promise.resolve(params.hasESData || false), - hasDataView: () => Promise.resolve(params.hasDataView || false), - hasUserDataView: () => Promise.resolve(params.hasUserDataView || false), - }; -}; diff --git a/packages/kbn-shared-ux-storybook/src/services/doc_links.ts b/packages/kbn-shared-ux-storybook/src/services/doc_links.ts deleted file mode 100644 index eff942989956f..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/doc_links.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. - */ - -import { ServiceFactory, SharedUxDocLinksService } from '@kbn/shared-ux-services'; - -/** - * A factory function for creating a Storybook implementation of `SharedUxDocLinksService`. - */ -export type SharedUxDocLinksServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Storybook implementation of `SharedUxDocLinksService`. - */ -export const docLinksServiceFactory: SharedUxDocLinksServiceFactory = () => ({ - dataViewsDocLink: 'https://www.elastic.co/guide/en/kibana/master/data-views.html', - kibanaGuideDocLink: 'https://www.elastic.co/guide/en/kibana/master/index.html', -}); diff --git a/packages/kbn-shared-ux-storybook/src/services/editors.ts b/packages/kbn-shared-ux-storybook/src/services/editors.ts deleted file mode 100644 index 69b9d7062da94..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/editors.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. - */ - -import { action } from '@storybook/addon-actions'; -import { ServiceFactory, SharedUxEditorsService } from '@kbn/shared-ux-services'; - -/** - * A factory function for creating a Storybook implementation of `SharedUxEditorsService`. - */ -export type SharedUxEditorsServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Storybook implementation of `SharedUxEditorsService`. - */ -export const editorsServiceFactory: SharedUxEditorsServiceFactory = () => ({ - openDataViewEditor: action('openEditor') as SharedUxEditorsService['openDataViewEditor'], -}); diff --git a/packages/kbn-shared-ux-storybook/src/services/http.ts b/packages/kbn-shared-ux-storybook/src/services/http.ts deleted file mode 100644 index f44fb10566dc3..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/http.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 { action } from '@storybook/addon-actions'; - -import { ServiceFactory, SharedUxHttpService } from '@kbn/shared-ux-services'; - -/** - * A factory function for creating a Storybook-based implementation of `SharedUXHttpService`. - */ -export type HttpServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Storybook-based implementation of `SharedUXHttpService`. - */ -export const httpServiceFactory: HttpServiceFactory = () => ({ - addBasePath: action('addBasePath') as SharedUxHttpService['addBasePath'], -}); diff --git a/packages/kbn-shared-ux-storybook/src/services/index.ts b/packages/kbn-shared-ux-storybook/src/services/index.ts deleted file mode 100644 index ff6ad1f1f2913..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/index.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 type { ServiceFactory, SharedUxServices } from '@kbn/shared-ux-services'; - -import { applicationServiceFactory } from './application'; -import { docLinksServiceFactory } from './doc_links'; -import { editorsServiceFactory } from './editors'; -import { httpServiceFactory } from './http'; -import { platformServiceFactory } from './platform'; -import { userPermissionsServiceFactory } from './permissions'; -import { dataServiceFactory, DataServiceFactoryConfig } from './data'; - -export { applicationServiceFactory } from './application'; -export { docLinksServiceFactory } from './doc_links'; -export { editorsServiceFactory } from './editors'; -export { httpServiceFactory } from './http'; -export { platformServiceFactory } from './platform'; -export { userPermissionsServiceFactory } from './permissions'; -export { dataServiceFactory } from './data'; - -/** - * A factory function for creating a Storybook implementation of `SharedUxServices`. - */ -export const servicesFactory: ServiceFactory = (params) => ({ - application: applicationServiceFactory(), - docLinks: docLinksServiceFactory(), - editors: editorsServiceFactory(), - http: httpServiceFactory(params), - permissions: userPermissionsServiceFactory(), - platform: platformServiceFactory(params), - data: dataServiceFactory(params as DataServiceFactoryConfig), -}); - -export type { DataServiceFactoryConfig } from './data'; diff --git a/packages/kbn-shared-ux-storybook/src/services/permissions.ts b/packages/kbn-shared-ux-storybook/src/services/permissions.ts deleted file mode 100644 index 5d00ac3ee1cb2..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/permissions.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. - */ - -import { ServiceFactory, SharedUxUserPermissionsService } from '@kbn/shared-ux-services'; - -/** - * A factory function for creating a Storybook implementation of `SharedUxUserPermissionsService`. - */ -export type SharedUxUserPermissionsServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Storybook implementation of `SharedUxUserPermissionsService`. - */ -export const userPermissionsServiceFactory: SharedUxUserPermissionsServiceFactory = () => ({ - canCreateNewDataView: true, - canAccessFleet: true, -}); diff --git a/packages/kbn-shared-ux-storybook/src/services/platform.ts b/packages/kbn-shared-ux-storybook/src/services/platform.ts deleted file mode 100644 index 2a1cb6c3ff42b..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/platform.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. - */ - -import { action } from '@storybook/addon-actions'; -import { ServiceFactory, SharedUxPlatformService } from '@kbn/shared-ux-services'; - -/** - * A factory function for creating a Storybook implementation of `SharedUxPlatformService`. - */ -export type PlatformServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Storybook implementation of `SharedUxPlatformService`. - */ -export const platformServiceFactory: PlatformServiceFactory = () => ({ - setIsFullscreen: action('setIsChromeVisible'), -}); diff --git a/packages/kbn-test/README.mdx b/packages/kbn-test/README.mdx index 5a6129bffd5a9..5e52b68b7a0cb 100644 --- a/packages/kbn-test/README.mdx +++ b/packages/kbn-test/README.mdx @@ -1,19 +1,17 @@ --- id: kibDevDocsOpsTest slug: /kibana-dev-docs/ops/test -title: "@kbn/test" +title: '@kbn/test' description: A package provide ways to run tests date: 2022-08-15 tags: ['kibana', 'dev', 'contributor', 'operations', 'cli', 'dev', 'mode', 'test'] --- -Kibana Testing Library -====================== +# Kibana Testing Library The @kbn/test package provides ways to run tests. Currently only functional testing is provided by this library, with unit and other testing possibly added here. -Functional Testing -------------------- +## Functional Testing ### Dependencies @@ -21,14 +19,16 @@ Functional testing methods exist in the `src/functional_tests` directory. They d ### Exposed methods -#### runTests(configPaths: Array) +#### `runTests(configPaths: Array)` + For each config file specified in configPaths, starts Elasticsearch and Kibana once, runs tests specified in that config file, and shuts down Elasticsearch and Kibana once completed. (Repeats for every config file.) `configPaths`: array of strings, each an absolute path to a config file that looks like [this](../../test/functional/config.base.js), following the config schema specified [here](../../src/functional_test_runner/lib/config/schema.js). Internally the method that starts Elasticsearch comes from [kbn-es](../../packages/kbn-es). -#### startServers(configPath: string) +#### `startServers(configPath: string)` + Starts Elasticsearch and Kibana servers given a specified config. `configPath`: absolute path to a config file that looks like [this](../../test/functional/config.base.js), following the config schema specified [here](../../src/functional_test_runner/lib/config/schema.js). diff --git a/packages/kbn-test/src/jest/setup/enzyme.js b/packages/kbn-test/src/jest/setup/enzyme.js index c0ebcb93fc4a2..bf759523cfe7a 100644 --- a/packages/kbn-test/src/jest/setup/enzyme.js +++ b/packages/kbn-test/src/jest/setup/enzyme.js @@ -7,6 +7,6 @@ */ import { configure } from 'enzyme'; -import Adapter from 'enzyme-adapter-react-16'; +import Adapter from '@wojtekmaj/enzyme-adapter-react-17'; configure({ adapter: new Adapter() }); diff --git a/packages/kbn-ui-shared-deps-npm/BUILD.bazel b/packages/kbn-ui-shared-deps-npm/BUILD.bazel index 8f3823a56b2d9..94ea101c61003 100644 --- a/packages/kbn-ui-shared-deps-npm/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-npm/BUILD.bazel @@ -50,7 +50,6 @@ RUNTIME_DEPS = [ "@npm//react-router-dom", "@npm//react-router", "@npm//react", - "@npm//regenerator-runtime", "@npm//rison-node", "@npm//rxjs", "@npm//styled-components", @@ -87,7 +86,6 @@ TYPES_DEPS = [ "@npm//react-is", "@npm//react-router", "@npm//react-router-dom", - "@npm//regenerator-runtime", "@npm//rison-node", "@npm//rxjs", "@npm//styled-components", diff --git a/packages/kbn-ui-shared-deps-npm/webpack.config.js b/packages/kbn-ui-shared-deps-npm/webpack.config.js index ddcb71fdb2c86..8096e9ea6e429 100644 --- a/packages/kbn-ui-shared-deps-npm/webpack.config.js +++ b/packages/kbn-ui-shared-deps-npm/webpack.config.js @@ -34,7 +34,6 @@ module.exports = (_, argv) => { 'kbn-ui-shared-deps-npm': [ // polyfill code 'core-js/stable', - 'regenerator-runtime/runtime', 'whatwg-fetch', 'symbol-observable', // Parts of node-libs-browser that are used in many places across Kibana @@ -50,30 +49,35 @@ module.exports = (_, argv) => { * node scripts/find_babel_runtime_helpers_in_use.js */ '@babel/runtime/helpers/assertThisInitialized', + '@babel/runtime/helpers/asyncToGenerator', '@babel/runtime/helpers/classCallCheck', '@babel/runtime/helpers/classPrivateFieldGet', '@babel/runtime/helpers/classPrivateFieldSet', + '@babel/runtime/helpers/createClass', + '@babel/runtime/helpers/createForOfIteratorHelper', '@babel/runtime/helpers/createSuper', '@babel/runtime/helpers/defineProperty', '@babel/runtime/helpers/extends', '@babel/runtime/helpers/inherits', + '@babel/runtime/helpers/inheritsLoose', '@babel/runtime/helpers/interopRequireDefault', '@babel/runtime/helpers/interopRequireWildcard', '@babel/runtime/helpers/objectSpread2', '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/objectWithoutPropertiesLoose', '@babel/runtime/helpers/slicedToArray', - '@babel/runtime/helpers/toArray', + '@babel/runtime/helpers/taggedTemplateLiteralLoose', '@babel/runtime/helpers/toConsumableArray', '@babel/runtime/helpers/typeof', '@babel/runtime/helpers/wrapNativeSuper', + '@babel/runtime/regenerator', // modules from npm '@elastic/charts', '@elastic/eui', + '@elastic/eui/optimize/es/services', + '@elastic/eui/optimize/es/services/format', '@elastic/eui/dist/eui_charts_theme', - '@elastic/eui/lib/services', - '@elastic/eui/lib/services/format', '@elastic/eui/dist/eui_theme_light.json', '@elastic/eui/dist/eui_theme_dark.json', '@elastic/numeral', diff --git a/packages/kbn-ui-shared-deps-src/BUILD.bazel b/packages/kbn-ui-shared-deps-src/BUILD.bazel index 18d50fdc05e63..db8d6c64fb6db 100644 --- a/packages/kbn-ui-shared-deps-src/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-src/BUILD.bazel @@ -27,7 +27,7 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", "//packages/kbn-analytics", "//packages/kbn-babel-preset", "//packages/kbn-datemath", @@ -41,7 +41,7 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-analytics:npm_module_types", "//packages/kbn-datemath:npm_module_types", "//packages/kbn-i18n:npm_module_types", diff --git a/packages/kbn-ui-shared-deps-src/src/definitions.js b/packages/kbn-ui-shared-deps-src/src/definitions.js index 3e783d99b62cf..759b1bee856d2 100644 --- a/packages/kbn-ui-shared-deps-src/src/definitions.js +++ b/packages/kbn-ui-shared-deps-src/src/definitions.js @@ -75,7 +75,7 @@ const externals = { tslib: '__kbnSharedDeps__.TsLib', '@kbn/analytics': '__kbnSharedDeps__.KbnAnalytics', '@kbn/std': '__kbnSharedDeps__.KbnStd', - '@elastic/safer-lodash-set': '__kbnSharedDeps__.SaferLodashSet', + '@kbn/safer-lodash-set': '__kbnSharedDeps__.SaferLodashSet', 'rison-node': '__kbnSharedDeps__.RisonNode', history: '__kbnSharedDeps__.History', classnames: '__kbnSharedDeps__.Classnames', diff --git a/packages/kbn-ui-shared-deps-src/src/entry.js b/packages/kbn-ui-shared-deps-src/src/entry.js index bc521a2d72ecc..233872bacff58 100644 --- a/packages/kbn-ui-shared-deps-src/src/entry.js +++ b/packages/kbn-ui-shared-deps-src/src/entry.js @@ -39,8 +39,8 @@ export const RxjsOperators = require('rxjs/operators'); export const ElasticNumeral = require('@elastic/numeral'); export const ElasticCharts = require('@elastic/charts'); export const ElasticEui = require('@elastic/eui'); -export const ElasticEuiLibServices = require('@elastic/eui/lib/services'); -export const ElasticEuiLibServicesFormat = require('@elastic/eui/lib/services/format'); +export const ElasticEuiLibServices = require('@elastic/eui/optimize/es/services'); +export const ElasticEuiLibServicesFormat = require('@elastic/eui/optimize/es/services/format'); export const ElasticEuiChartsTheme = require('@elastic/eui/dist/eui_charts_theme'); export const KbnDatemath = require('@kbn/datemath'); export const ReactBeautifulDnD = require('react-beautiful-dnd'); @@ -55,7 +55,7 @@ export const Fflate = { unzlibSync, strFromU8 }; export const TsLib = require('tslib'); export const KbnAnalytics = require('@kbn/analytics'); export const KbnStd = require('@kbn/std'); -export const SaferLodashSet = require('@elastic/safer-lodash-set'); +export const SaferLodashSet = require('@kbn/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/src/polyfills.js b/packages/kbn-ui-shared-deps-src/src/polyfills.js index a9ec32023f2bf..cc8e1f9b75d5c 100644 --- a/packages/kbn-ui-shared-deps-src/src/polyfills.js +++ b/packages/kbn-ui-shared-deps-src/src/polyfills.js @@ -7,7 +7,7 @@ */ require('core-js/stable'); -require('regenerator-runtime/runtime'); +require('@babel/runtime/regenerator'); if (typeof window.Event === 'object') { // IE11 doesn't support unknown event types, required by react-use diff --git a/packages/shared-ux/avatar/solution/src/solution_avatar.stories.tsx b/packages/shared-ux/avatar/solution/src/solution_avatar.stories.tsx index b47ff7c837f24..f7dca09fc8b1f 100644 --- a/packages/shared-ux/avatar/solution/src/solution_avatar.stories.tsx +++ b/packages/shared-ux/avatar/solution/src/solution_avatar.stories.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { KibanaSolutionAvatar, IconTypeProps, KnownSolutionProps } from './solution_avatar'; export default { - title: 'Solution Avatar', + title: 'Avatar/Solution', description: 'A wrapper around EuiAvatar, specifically to stylize Elastic Solutions', }; @@ -24,11 +24,11 @@ const argTypes = { type KnownSolutionParams = Pick; -export const SolutionAvatar = (params: KnownSolutionParams) => { +export const SolutionType = (params: KnownSolutionParams) => { return ; }; -SolutionAvatar.argTypes = { +SolutionType.argTypes = { name: { control: 'select', options: ['Cloud', 'Elastic', 'Kibana', 'Observability', 'Security', 'Enterprise Search'], @@ -39,11 +39,11 @@ SolutionAvatar.argTypes = { type IconTypeParams = Pick; -export const IconTypeAvatar = (params: IconTypeParams) => { +export const IconType = (params: IconTypeParams) => { return ; }; -IconTypeAvatar.argTypes = { +IconType.argTypes = { iconType: { control: 'select', options: [ diff --git a/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel b/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel index cd88ae0f1fe27..50a3e109546cd 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel +++ b/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel @@ -10,8 +10,17 @@ SOURCE_FILES = glob( "src/**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -38,6 +47,7 @@ NPM_MODULE_EXTRA_FILES = [ # eg. "@npm//lodash" RUNTIME_DEPS = [ "@npm//@storybook/addon-actions", + "@npm//react", "//packages/shared-ux/storybook/mock", ] @@ -53,6 +63,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", + "@npm//@types/react", "@npm//@storybook/addon-actions", "//packages/shared-ux/button/exit_full_screen/types:npm_module_types", "//packages/shared-ux/storybook/mock:npm_module_types", @@ -65,6 +76,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -90,7 +109,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/button/exit_full_screen/mocks/package.json b/packages/shared-ux/button/exit_full_screen/mocks/package.json index 490d136049e1a..1ce5731e7bee3 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/package.json +++ b/packages/shared-ux/button/exit_full_screen/mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json b/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json index 894f01d3220e9..dc96ec41f9035 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json +++ b/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json @@ -9,10 +9,12 @@ "stripInternal": false, "types": [ "jest", - "node" + "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/packages/shared-ux/card/no_data/impl/src/no_data_card.stories.tsx b/packages/shared-ux/card/no_data/impl/src/no_data_card.stories.tsx index 5c7b1a57c11f2..8574b31da792a 100644 --- a/packages/shared-ux/card/no_data/impl/src/no_data_card.stories.tsx +++ b/packages/shared-ux/card/no_data/impl/src/no_data_card.stories.tsx @@ -11,8 +11,7 @@ import React from 'react'; import { NoDataCardStorybookMock } from '@kbn/shared-ux-card-no-data-mocks'; import type { NoDataCardStorybookParams } from '@kbn/shared-ux-card-no-data-mocks'; -import { NoDataCard as Component } from './no_data_card.component'; -import { NoDataCard as ConnectedComponent } from './no_data_card'; +import { NoDataCard } from './no_data_card'; import { NoDataCardProvider } from './services'; import mdx from '../README.mdx'; @@ -28,21 +27,14 @@ export default { }; const mock = new NoDataCardStorybookMock(); - const argTypes = mock.getArgumentTypes(); -export const NoDataCard = (params: NoDataCardStorybookParams) => { +export const Card = (params: NoDataCardStorybookParams) => { return ( - + ); }; -NoDataCard.argTypes = argTypes; - -export const NoDataCardComponent = (params: NoDataCardStorybookParams) => { - return ; -}; - -NoDataCardComponent.argTypes = argTypes; +Card.argTypes = argTypes; diff --git a/packages/shared-ux/card/no_data/mocks/BUILD.bazel b/packages/shared-ux/card/no_data/mocks/BUILD.bazel index dbfc44a31b864..3aec9c86207c9 100644 --- a/packages/shared-ux/card/no_data/mocks/BUILD.bazel +++ b/packages/shared-ux/card/no_data/mocks/BUILD.bazel @@ -10,8 +10,17 @@ SOURCE_FILES = glob( "src/**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -39,6 +48,8 @@ NPM_MODULE_EXTRA_FILES = [ RUNTIME_DEPS = [ "@npm//@storybook/addon-actions", "@npm//deepmerge", + "@npm//lodash", + "@npm//react", "//packages/shared-ux/link/redirect_app/mocks", "//packages/shared-ux/storybook/mock", ] @@ -53,13 +64,15 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", "@npm//@storybook/addon-actions", + "@npm//@types/jest", + "@npm//@types/lodash", + "@npm//@types/node", + "@npm//@types/react", "@npm//deepmerge", - "//packages/shared-ux/storybook/mock:npm_module_types", - "//packages/shared-ux/link/redirect_app/mocks:npm_module_types", "//packages/shared-ux/card/no_data/types:npm_module_types", + "//packages/shared-ux/link/redirect_app/mocks:npm_module_types", + "//packages/shared-ux/storybook/mock:npm_module_types", ] jsts_transpiler( @@ -69,6 +82,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -94,7 +115,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/card/no_data/mocks/package.json b/packages/shared-ux/card/no_data/mocks/package.json index d9f12c7e81fcd..10380b879954c 100644 --- a/packages/shared-ux/card/no_data/mocks/package.json +++ b/packages/shared-ux/card/no_data/mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/card/no_data/mocks/src/jest.ts b/packages/shared-ux/card/no_data/mocks/src/jest.ts index bf8ac47239bcf..9a89d0cd3b747 100644 --- a/packages/shared-ux/card/no_data/mocks/src/jest.ts +++ b/packages/shared-ux/card/no_data/mocks/src/jest.ts @@ -5,7 +5,10 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + import deepmerge from 'deepmerge'; +import { isPlainObject } from 'lodash'; + import type { NoDataCardServices, NoDataCardKibanaDependencies, @@ -43,7 +46,7 @@ export const getKibanaDependenciesMock = ( const integrations = params.canAccessFleet !== undefined ? params.canAccessFleet : defaultParams.canAccessFleet; - return deepmerge( + const result = deepmerge( { coreStart: { http: { @@ -60,6 +63,11 @@ export const getKibanaDependenciesMock = ( }, }, }, - getRedirectAppLinksKibanaDependenciesMock() + getRedirectAppLinksKibanaDependenciesMock(), + { + isMergeableObject: isPlainObject, + } ); + + return result; }; diff --git a/packages/shared-ux/card/no_data/mocks/tsconfig.json b/packages/shared-ux/card/no_data/mocks/tsconfig.json index 894f01d3220e9..dc96ec41f9035 100644 --- a/packages/shared-ux/card/no_data/mocks/tsconfig.json +++ b/packages/shared-ux/card/no_data/mocks/tsconfig.json @@ -9,10 +9,12 @@ "stripInternal": false, "types": [ "jest", - "node" + "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.test.tsx b/packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.test.tsx index 6342f9f6e1f6a..56a6e1b4f7494 100644 --- a/packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.test.tsx +++ b/packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.test.tsx @@ -10,10 +10,14 @@ import React, { MouseEvent } from 'react'; import { mount as enzymeMount, ReactWrapper } from 'enzyme'; +import { + getRedirectAppLinksKibanaDependenciesMock, + getRedirectAppLinksServicesMock, +} from '@kbn/shared-ux-link-redirect-app-mocks'; + import { RedirectAppLinksKibanaProvider, RedirectAppLinksProvider } from './services'; import { RedirectAppLinks } from './redirect_app_links.container'; import { RedirectAppLinks as ComposedWrapper } from './redirect_app_links'; -import { Observable } from 'rxjs'; export type UnmountCallback = () => void; export type MountPoint = (element: T) => UnmountCallback; @@ -251,21 +255,8 @@ describe('RedirectAppLinks', () => { navigateToUrl.mockReset(); }); - const kibana = { - coreStart: { - application: { - currentAppId$: new Observable((subscriber) => { - subscriber.next('123'); - }), - navigateToUrl, - }, - }, - }; - - const services = { - currentAppId: 'abc123', - navigateToUrl, - }; + const kibana = getRedirectAppLinksKibanaDependenciesMock({ navigateToUrl }); + const services = getRedirectAppLinksServicesMock({ navigateToUrl }); const provider = (node: React.ReactElement) => enzymeMount({node}); diff --git a/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel b/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel index f0607a798c833..2b28f97f2f639 100644 --- a/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel +++ b/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel @@ -8,10 +8,20 @@ PKG_REQUIRE_NAME = "@kbn/shared-ux-link-redirect-app-mocks" SOURCE_FILES = glob( [ "src/**/*.ts", + "src/**/*.tsx", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -37,6 +47,7 @@ NPM_MODULE_EXTRA_FILES = [ # "@npm//name-of-package" # eg. "@npm//lodash" RUNTIME_DEPS = [ + "@npm//react", "@npm//@storybook/addon-actions", "@npm//rxjs", "//packages/shared-ux/storybook/mock", @@ -52,6 +63,9 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/react", "@npm//@storybook/addon-actions", "@npm//rxjs", "//packages/shared-ux/link/redirect_app/types", @@ -65,6 +79,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -90,7 +112,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/link/redirect_app/mocks/jest.config.js b/packages/shared-ux/link/redirect_app/mocks/jest.config.js index 6f1b6fd89f35e..ac5f8e5dcf92f 100644 --- a/packages/shared-ux/link/redirect_app/mocks/jest.config.js +++ b/packages/shared-ux/link/redirect_app/mocks/jest.config.js @@ -7,7 +7,7 @@ */ module.exports = { - preset: '@kbn/test/jest_node', + preset: '@kbn/test', rootDir: '../../../../..', roots: ['/packages/shared-ux/link/redirect_app/mocks'], }; diff --git a/packages/shared-ux/link/redirect_app/mocks/package.json b/packages/shared-ux/link/redirect_app/mocks/package.json index 2281680755a9c..adf441fb3d134 100644 --- a/packages/shared-ux/link/redirect_app/mocks/package.json +++ b/packages/shared-ux/link/redirect_app/mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} \ No newline at end of file +} diff --git a/packages/shared-ux/link/redirect_app/mocks/src/jest.ts b/packages/shared-ux/link/redirect_app/mocks/src/jest.ts index 57e6650d17752..1af5aa6e72a11 100644 --- a/packages/shared-ux/link/redirect_app/mocks/src/jest.ts +++ b/packages/shared-ux/link/redirect_app/mocks/src/jest.ts @@ -6,31 +6,53 @@ * Side Public License, v 1. */ -import { Subject } from 'rxjs'; +import { Observable } from 'rxjs'; import { RedirectAppLinksServices, RedirectAppLinksKibanaDependencies, } from '@kbn/shared-ux-link-redirect-app-types'; +type Params = Pick; + +const defaultParams: Params = { + navigateToUrl: jest.fn(), +}; + /** * Returns the Jest-compatible service abstractions for the `NoDataCard` Provider. */ -export const getRedirectAppLinksServicesMock = () => { +export const getRedirectAppLinksServicesMock = ( + params?: Partial +): RedirectAppLinksServices => { + const navigateToUrl = + params && params.navigateToUrl !== undefined + ? params.navigateToUrl + : defaultParams.navigateToUrl; + const services: RedirectAppLinksServices = { - navigateToUrl: jest.fn(), + navigateToUrl, currentAppId: 'currentAppId', }; return services; }; -export const getRedirectAppLinksKibanaDependenciesMock = (): RedirectAppLinksKibanaDependencies => { +export const getRedirectAppLinksKibanaDependenciesMock = ( + params?: Partial +): RedirectAppLinksKibanaDependencies => { + const navigateToUrl = + params && params.navigateToUrl !== undefined + ? params.navigateToUrl + : defaultParams.navigateToUrl; + return { coreStart: { application: { - currentAppId$: new Subject(), - navigateToUrl: jest.fn(), + currentAppId$: new Observable((subscriber) => { + subscriber.next('currentAppId'); + }), + navigateToUrl, }, }, }; diff --git a/packages/shared-ux/link/redirect_app/mocks/tsconfig.json b/packages/shared-ux/link/redirect_app/mocks/tsconfig.json index 041c59b490ec0..dc96ec41f9035 100644 --- a/packages/shared-ux/link/redirect_app/mocks/tsconfig.json +++ b/packages/shared-ux/link/redirect_app/mocks/tsconfig.json @@ -10,9 +10,11 @@ "types": [ "jest", "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/packages/shared-ux/page/analytics_no_data/impl/src/analytics_no_data_page.stories.tsx b/packages/shared-ux/page/analytics_no_data/impl/src/analytics_no_data_page.stories.tsx index 0e6a4261c8c2d..5c9c5923bfdc6 100644 --- a/packages/shared-ux/page/analytics_no_data/impl/src/analytics_no_data_page.stories.tsx +++ b/packages/shared-ux/page/analytics_no_data/impl/src/analytics_no_data_page.stories.tsx @@ -7,7 +7,6 @@ */ import React from 'react'; -import { action } from '@storybook/addon-actions'; import { AnalyticsNoDataPageStorybookMock } from '@kbn/shared-ux-page-analytics-no-data-mocks'; import type { AnalyticsNoDataPageStorybookParams } from '@kbn/shared-ux-page-analytics-no-data-mocks'; @@ -18,7 +17,7 @@ import mdx from '../README.mdx'; const mock = new AnalyticsNoDataPageStorybookMock(); export default { - title: 'No Data/Analytics Page', + title: 'No Data/Page/Kibana', description: 'An Analytics-specific version of KibanaNoDataPage.', parameters: { docs: { @@ -27,7 +26,7 @@ export default { }, }; -export const AnalyticsNoDataPage = (params: AnalyticsNoDataPageStorybookParams) => { +export const Analytics = (params: AnalyticsNoDataPageStorybookParams) => { return ( @@ -35,22 +34,4 @@ export const AnalyticsNoDataPage = (params: AnalyticsNoDataPageStorybookParams) ); }; -AnalyticsNoDataPage.argTypes = mock.getArgumentTypes(); - -export const LoadingState = (params: AnalyticsNoDataPageStorybookParams) => { - // Simulate loading with a Promise that doesn't resolve. - const dataCheck = () => new Promise((_reject, _resolve) => {}); - - const services = { - ...mock.getServices(params), - hasESData: dataCheck, - hasUserDataView: dataCheck, - hasDataView: dataCheck, - }; - - return ( - - - - ); -}; +Analytics.argTypes = mock.getArgumentTypes(); diff --git a/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel b/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel index 6d78e72892bfc..1600004860f88 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel +++ b/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel @@ -10,8 +10,17 @@ SOURCE_FILES = glob( "src/**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -37,7 +46,9 @@ NPM_MODULE_EXTRA_FILES = [ # "@npm//name-of-package" # eg. "@npm//lodash" RUNTIME_DEPS = [ + "@npm//react", "//packages/shared-ux/page/kibana_no_data/mocks", + "//packages/shared-ux/storybook/mock", ] # In this array place dependencies necessary to build the types, which will include the @@ -50,10 +61,12 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "@npm//@types/node", "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", "//packages/shared-ux/page/analytics_no_data/types:npm_module_types", "//packages/shared-ux/page/kibana_no_data/mocks:npm_module_types", + "//packages/shared-ux/storybook/mock:npm_module_types", ] jsts_transpiler( @@ -63,6 +76,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -88,7 +109,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/analytics_no_data/mocks/jest.config.js b/packages/shared-ux/page/analytics_no_data/mocks/jest.config.js deleted file mode 100644 index ba5df95ec80fb..0000000000000 --- a/packages/shared-ux/page/analytics_no_data/mocks/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/jest_node', - rootDir: '../../../../..', - roots: ['/packages/shared-ux/page/analytics_no_data/mocks'], -}; diff --git a/packages/shared-ux/page/analytics_no_data/mocks/package.json b/packages/shared-ux/page/analytics_no_data/mocks/package.json index 30850ab7355ab..6fc9704e831f1 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/package.json +++ b/packages/shared-ux/page/analytics_no_data/mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json b/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json index 894f01d3220e9..dc96ec41f9035 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json +++ b/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json @@ -9,10 +9,12 @@ "stripInternal": false, "types": [ "jest", - "node" + "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel b/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel index 2fc986d65c1a4..7b1e16f9db829 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel +++ b/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel @@ -44,9 +44,8 @@ RUNTIME_DEPS = [ "@npm//@emotion/react", "@npm//react", "//packages/kbn-i18n", - "//packages/kbn-shared-ux-components", - "//packages/kbn-shared-ux-services", "//packages/shared-ux/prompt/no_data_views/impl", + "//packages/shared-ux/page/no_data_config/impl", ] # In this array place dependencies necessary to build the types, which will include the @@ -67,10 +66,10 @@ TYPES_DEPS = [ "@npm//@types/react", "//packages/kbn-ambient-ui-types", "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-shared-ux-components:npm_module_types", - "//packages/kbn-shared-ux-services:npm_module_types", "//packages/shared-ux/prompt/no_data_views/impl:npm_module_types", - "//packages/shared-ux/page/kibana_no_data/types:npm_module_types", + "//packages/shared-ux/page/no_data_config/impl:npm_module_types", + "//packages/shared-ux/page/no_data_config/types", + "//packages/shared-ux/page/kibana_no_data/types", ] jsts_transpiler( diff --git a/packages/shared-ux/page/kibana_no_data/impl/README.mdx b/packages/shared-ux/page/kibana_no_data/impl/README.mdx index bc5dc37ac679a..f74adf2465e3b 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/README.mdx +++ b/packages/shared-ux/page/kibana_no_data/impl/README.mdx @@ -14,7 +14,7 @@ The `KibanaNoDataPage` connected component uses: - `hasUserDataView` and `hasData` API from the `HasData` service in the `data_views` plugin to check for existence of data an data views. - `onDataViewCreated` callback once a data view has been created. -- (noDataConfig)[https://github.com/elastic/kibana/blob/main/packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts] as configuration for the page in case of no data. +- (noDataConfig)[https://github.com/elastic/kibana/blob/main/packages/shared-ux/page/no_data/types/index.d.ts] as configuration for the page in case of no data. ## API diff --git a/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.stories.tsx b/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.stories.tsx index f38b079dffec7..60cc78d95215c 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.stories.tsx +++ b/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.stories.tsx @@ -17,7 +17,7 @@ import { KibanaNoDataPageProvider } from './services'; import mdx from '../README.mdx'; export default { - title: 'No Data/Kibana Page', + title: 'No Data/Page/Kibana', description: 'A component to display when there is no data available', parameters: { docs: { @@ -28,7 +28,7 @@ export default { const mock = new KibanaNoDataPageStorybookMock(); -export const KibanaNoDataPage = (params: KibanaNoDataPageStorybookParams) => { +export const Kibana = (params: KibanaNoDataPageStorybookParams) => { return ( @@ -36,7 +36,7 @@ export const KibanaNoDataPage = (params: KibanaNoDataPageStorybookParams) => { ); }; -KibanaNoDataPage.argTypes = mock.getArgumentTypes(); +Kibana.argTypes = mock.getArgumentTypes(); export const LoadingState = (params: KibanaNoDataPageStorybookParams) => { // Simulate loading with a Promise that doesn't resolve. diff --git a/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.test.tsx b/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.test.tsx index 7a0e0cd7e4f00..c15a5c061dd1b 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.test.tsx +++ b/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.test.tsx @@ -12,7 +12,7 @@ import { act } from 'react-dom/test-utils'; import { EuiLoadingElastic } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import { NoDataViewsPrompt } from '@kbn/shared-ux-prompt-no-data-views'; -import { NoDataConfigPage } from '@kbn/shared-ux-components'; +import { NoDataConfigPage } from '@kbn/shared-ux-page-no-data-config'; import { getKibanaNoDataPageServicesMock } from '@kbn/shared-ux-page-kibana-no-data-mocks'; import { KibanaNoDataPage } from './kibana_no_data_page'; @@ -43,7 +43,7 @@ describe('Kibana No Data Page', () => { }); test('renders NoDataConfigPage', async () => { - const services = getKibanaNoDataPageServicesMock({ config: { ...config, hasESData: false } }); + const services = getKibanaNoDataPageServicesMock(config); const component = mountWithIntl( @@ -58,7 +58,7 @@ describe('Kibana No Data Page', () => { }); test('renders NoDataViews', async () => { - const services = getKibanaNoDataPageServicesMock({ config: { ...config, hasESData: true } }); + const services = getKibanaNoDataPageServicesMock({ ...config, hasESData: true }); const component = mountWithIntl( diff --git a/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.tsx b/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.tsx index f2ac573232f34..73726d7b82eaa 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.tsx +++ b/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.tsx @@ -7,7 +7,7 @@ */ import React, { useEffect, useState } from 'react'; import { EuiLoadingElastic } from '@elastic/eui'; -import { NoDataConfigPage } from '@kbn/shared-ux-components'; +import { NoDataConfigPage } from '@kbn/shared-ux-page-no-data-config'; import { NoDataViewsPrompt } from '@kbn/shared-ux-prompt-no-data-views'; import { KibanaNoDataPageProps } from '@kbn/shared-ux-page-kibana-no-data-types'; diff --git a/packages/shared-ux/page/kibana_no_data/impl/src/legacy_services.tsx b/packages/shared-ux/page/kibana_no_data/impl/src/legacy_services.tsx deleted file mode 100644 index 2a9580bb74684..0000000000000 --- a/packages/shared-ux/page/kibana_no_data/impl/src/legacy_services.tsx +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may 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 { SharedUxServicesProvider as LegacyServicesProvider } from '@kbn/shared-ux-services'; -export type { SharedUxServices as LegacyServices } from '@kbn/shared-ux-services'; - -import { SharedUxServices as LegacyServices } from '@kbn/shared-ux-services'; -import type { KibanaNoDataPageServices } from '@kbn/shared-ux-page-kibana-no-data-types'; - -/** - * This list is temporary, a stop-gap as we migrate to a package-based architecture, where - * services are not collected in a single package. In order to make the transition, this - * interface is intentionally "flat". - * - * Expect this list to dwindle to zero as `@kbn/shared-ux-components` are migrated to their - * own packages, (and `@kbn/shared-ux-services` is removed). - */ -export const getLegacyServices = (services: KibanaNoDataPageServices): LegacyServices => ({ - application: { - currentAppId$: services.currentAppId$, - navigateToUrl: services.navigateToUrl, - }, - data: { - hasESData: services.hasESData, - hasDataView: services.hasDataView, - hasUserDataView: services.hasUserDataView, - }, - docLinks: { - dataViewsDocLink: services.dataViewsDocLink, - }, - editors: { - openDataViewEditor: services.openDataViewEditor, - }, - http: { - addBasePath: services.addBasePath, - }, - permissions: { - canAccessFleet: services.canAccessFleet, - canCreateNewDataView: services.canCreateNewDataView, - }, - platform: { - setIsFullscreen: services.setIsFullscreen, - }, -}); diff --git a/packages/shared-ux/page/kibana_no_data/impl/src/services.tsx b/packages/shared-ux/page/kibana_no_data/impl/src/services.tsx index 0aab90ce9f504..3ebab02d63790 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/src/services.tsx +++ b/packages/shared-ux/page/kibana_no_data/impl/src/services.tsx @@ -15,13 +15,12 @@ import { import { NoDataCardProvider, NoDataCardKibanaProvider } from '@kbn/shared-ux-card-no-data'; import { + Services, KibanaNoDataPageServices, KibanaNoDataPageKibanaDependencies, } from '@kbn/shared-ux-page-kibana-no-data-types'; -import { LegacyServicesProvider, getLegacyServices } from './legacy_services'; - -const KibanaNoDataPageContext = React.createContext(null); +const KibanaNoDataPageContext = React.createContext(null); /** * A Context Provider that provides services to the component. @@ -29,15 +28,17 @@ const KibanaNoDataPageContext = React.createContext = ({ children, ...services -}) => ( - - - - {children} - - - -); +}) => { + const { hasESData, hasUserDataView } = services; + + return ( + + + {children} + + + ); +}; /** * Kibana-specific Provider that maps dependencies to services. @@ -46,27 +47,16 @@ export const KibanaNoDataPageKibanaProvider: FC { - const { coreStart, dataViewEditor, dataViews } = dependencies; - const value: KibanaNoDataPageServices = { - addBasePath: coreStart.http.basePath.prepend, - canAccessFleet: coreStart.application.capabilities.navLinks.integrations, - canCreateNewDataView: dataViewEditor.userPermissions.editDataView(), - currentAppId$: coreStart.application.currentAppId$, - dataViewsDocLink: coreStart.docLinks.links.indexPatterns?.introduction, - hasDataView: dataViews.hasData.hasDataView, + const { dataViews } = dependencies; + const value: Services = { hasESData: dataViews.hasData.hasESData, hasUserDataView: dataViews.hasData.hasUserDataView, - navigateToUrl: coreStart.application.navigateToUrl, - openDataViewEditor: dataViewEditor.openEditor, - setIsFullscreen: (isVisible: boolean) => coreStart.chrome.setIsVisible(isVisible), }; return ( - - {children} - + {children} ); diff --git a/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel b/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel index 2c195edb6de03..7f8c4c03fc92d 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel +++ b/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel @@ -10,8 +10,17 @@ SOURCE_FILES = glob( "src/**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -37,8 +46,10 @@ NPM_MODULE_EXTRA_FILES = [ # "@npm//name-of-package" # eg. "@npm//lodash" RUNTIME_DEPS = [ - "//packages/shared-ux/prompt/no_data_views/mocks", + "@npm//react", "//packages/shared-ux/card/no_data/mocks", + "//packages/shared-ux/prompt/no_data_views/mocks", + "//packages/shared-ux/storybook/mock", ] # In this array place dependencies necessary to build the types, which will include the @@ -51,12 +62,14 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "@npm//@types/node", "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", + "//packages/shared-ux/card/no_data/mocks:npm_module_types", "//packages/shared-ux/page/kibana_no_data/types:npm_module_types", - "//packages/kbn-shared-ux-components:npm_module_types", + "//packages/shared-ux/page/no_data/types", "//packages/shared-ux/prompt/no_data_views/mocks:npm_module_types", - "//packages/shared-ux/card/no_data/mocks:npm_module_types", + "//packages/shared-ux/storybook/mock:npm_module_types", ] jsts_transpiler( @@ -66,6 +79,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -91,7 +112,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/kibana_no_data/mocks/jest.config.js b/packages/shared-ux/page/kibana_no_data/mocks/jest.config.js deleted file mode 100644 index 4c71cbdc32e91..0000000000000 --- a/packages/shared-ux/page/kibana_no_data/mocks/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/jest_node', - rootDir: '../../../../..', - roots: ['/packages/shared-ux/page/kibana_no_data/mocks'], -}; diff --git a/packages/shared-ux/page/kibana_no_data/mocks/package.json b/packages/shared-ux/page/kibana_no_data/mocks/package.json index 988bdc1d33aca..f134da02e430f 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/package.json +++ b/packages/shared-ux/page/kibana_no_data/mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_no_data/mocks/src/jest.ts b/packages/shared-ux/page/kibana_no_data/mocks/src/jest.ts index 33f26bafbd33d..5f2f6b309e56c 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/src/jest.ts +++ b/packages/shared-ux/page/kibana_no_data/mocks/src/jest.ts @@ -9,33 +9,34 @@ import { getNoDataCardServicesMock } from '@kbn/shared-ux-card-no-data-mocks'; import { KibanaNoDataPageServices } from '@kbn/shared-ux-page-kibana-no-data-types'; import { getNoDataViewsPromptServicesMock } from '@kbn/shared-ux-prompt-no-data-views-mocks'; -import { mockServicesFactory, MockServicesFactoryParams } from '@kbn/shared-ux-services'; + +interface Params { + hasESData: boolean; + hasUserDataView: boolean; +} + +const defaultParams = { + hasESData: true, + hasUserDataView: true, +}; /** * Returns the Jest-compatible service abstractions for the `KibanaNoDataPage` Provider. */ -export const getServicesMock = (params?: MockServicesFactoryParams) => { - const { canCreateNewDataView, dataViewsDocLink, openDataViewEditor } = - getNoDataViewsPromptServicesMock(); - - const { addBasePath, canAccessFleet } = getNoDataCardServicesMock(); +export const getServicesMock = (params?: Partial) => { + const hasESData = + params && params.hasESData !== undefined ? params.hasESData : defaultParams.hasESData; - const { application, data, docLinks, editors, http, permissions, platform } = - mockServicesFactory(params); + const hasUserDataView = + params && params.hasUserDataView !== undefined + ? params.hasUserDataView + : defaultParams.hasUserDataView; const services: KibanaNoDataPageServices = { - ...application, - ...data, - ...docLinks, - ...editors, - ...http, - ...permissions, - ...platform, - canCreateNewDataView, - dataViewsDocLink, - openDataViewEditor, - addBasePath, - canAccessFleet, + ...getNoDataCardServicesMock(), + ...getNoDataViewsPromptServicesMock(), + hasESData: async () => hasESData, + hasUserDataView: async () => hasUserDataView, }; return services; diff --git a/packages/shared-ux/page/kibana_no_data/mocks/src/storybook.ts b/packages/shared-ux/page/kibana_no_data/mocks/src/storybook.ts index 32dcdfe486580..1f4a7453e59b6 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/src/storybook.ts +++ b/packages/shared-ux/page/kibana_no_data/mocks/src/storybook.ts @@ -6,13 +6,14 @@ * Side Public License, v 1. */ -import { servicesFactory } from '@kbn/shared-ux-storybook'; +import { action } from '@storybook/addon-actions'; + import { AbstractStorybookMock, ArgumentParams } from '@kbn/shared-ux-storybook-mock'; import type { KibanaNoDataPageServices, KibanaNoDataPageProps, } from '@kbn/shared-ux-page-kibana-no-data-types'; -import type { NoDataPageProps } from '@kbn/shared-ux-components'; +import type { NoDataPageProps } from '@kbn/shared-ux-page-no-data-types'; import { NoDataViewsPromptStorybookMock, @@ -23,7 +24,6 @@ import { NoDataCardStorybookMock, NoDataCardStorybookParams, } from '@kbn/shared-ux-card-no-data-mocks'; -import { action } from '@storybook/addon-actions'; type PropArguments = Pick; type ServiceArguments = Pick; @@ -83,22 +83,11 @@ export class StorybookMock extends AbstractStorybookMock< } getServices(params: Params): KibanaNoDataPageServices { - // Workaround to leverage the services package. - const { application, data, docLinks, editors, http, permissions, platform } = - servicesFactory(params); - return { - ...application, - ...data, - ...docLinks, - ...editors, - ...http, - ...permissions, - ...platform, - hasESData: () => params.hasESData, - hasUserDataView: () => params.hasUserDataView, ...noDataCardMock.getServices(params), ...noDataViewsMock.getServices(params), + hasESData: () => params.hasESData, + hasUserDataView: () => params.hasUserDataView, }; } } diff --git a/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json b/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json index 894f01d3220e9..dc96ec41f9035 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json +++ b/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json @@ -9,10 +9,12 @@ "stripInternal": false, "types": [ "jest", - "node" + "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/packages/shared-ux/page/kibana_no_data/types/index.d.ts b/packages/shared-ux/page/kibana_no_data/types/index.d.ts index cfa1da12ccedf..18fe5499e93c3 100644 --- a/packages/shared-ux/page/kibana_no_data/types/index.d.ts +++ b/packages/shared-ux/page/kibana_no_data/types/index.d.ts @@ -6,109 +6,44 @@ * Side Public License, v 1. */ -import { Observable } from 'rxjs'; -import { NoDataPageProps } from '@kbn/shared-ux-components'; +import { NoDataPageProps } from '@kbn/shared-ux-page-no-data-types'; -/** - * TODO: `DataView` is a class exported by `src/plugins/data_views/public`. Since this service - * is contained in this package-- and packages can only depend on other packages and never on - * plugins-- we have to set this to `unknown`. If and when `DataView` is exported from a - * stateless package, we can remove this. - * - * @see: https://github.com/elastic/kibana/issues/127695 - */ -type DataView = unknown; - -/** - * A subset of the `DataViewEditorOptions` interface relevant to this component. - * - * @see: src/plugins/data_view_editor/public/types.ts - */ -interface DataViewEditorOptions { - /** Handler to be invoked when the Data View Editor completes a save operation. */ - onSave: (dataView: DataView) => void; -} +import { + NoDataViewsPromptServices, + NoDataViewsPromptKibanaDependencies, +} from '@kbn/shared-ux-prompt-no-data-views-types'; +import { + NoDataCardServices, + NoDataCardKibanaDependencies, +} from '@kbn/shared-ux-card-no-data-types'; -/** - * A list of Services that are consumed by this component. - * - * This list is temporary, a stopgap as we migrate to a package-based architecture, where - * services are not collected in a single package. In order to make the transition, this - * interface is intentionally "flat". - * - * Expect this list to dwindle to zero as `@kbn/shared-ux-components` are migrated to their - * own packages, (and `@kbn/shared-ux-services` is removed). - */ -export interface KibanaNoDataPageServices { +export interface Services { /** True if the cluster contains data, false otherwise. */ hasESData: () => Promise; /** True if Kibana instance contains user-created data view, false otherwise. */ hasUserDataView: () => Promise; - - // Provided to Legacy Services, not relevant to this component. Will be removed. - /** Append the server base path to a relative URL. */ - addBasePath: (url: string) => string; - /** True if the user has permission to access Fleet, false otherwise. */ - canAccessFleet: boolean; - /** True if the user has permission to create a new Data View, false otherwise. */ - canCreateNewDataView: boolean; - /** Observable storing the active, current application ID. */ - currentAppId$: Observable; - /** A link to information about Data Views in Kibana */ - dataViewsDocLink: string; - /** True if Kibana instance contains any data view, including system-created ones. */ - hasDataView: () => Promise; - /** Use Kibana to navigate async to a different URL. */ - navigateToUrl: (url: string) => Promise | void; - /** A method to open the Data View Editor flow. */ - openDataViewEditor: (options: DataViewEditorOptions) => () => void; - /** Set the Kibana chrome and browser to full screen mode. */ - setIsFullscreen: (isFullscreen: boolean) => void; } /** - * An interface containing a collection of Kibana plugins and services required to - * render this component and its dependencies. + * A list of Services that are consumed by this component.. */ -export interface KibanaNoDataPageKibanaDependencies { - coreStart: { - application: { - capabilities: { - navLinks: Record; - }; - currentAppId$: Observable; - navigateToUrl: (url: string) => Promise; - }; - chrome: { - setIsVisible: (isVisible: boolean) => void; - }; - docLinks: { - links: { - indexPatterns: { - introduction: string; - }; - }; - }; - http: { - basePath: { - prepend: (url: string) => string; - }; - }; - }; +export type KibanaNoDataPageServices = Services & NoDataCardServices & NoDataViewsPromptServices; + +export interface KibanaDependencies { dataViews: { hasData: { - hasDataView: () => Promise; hasESData: () => Promise; hasUserDataView: () => Promise; }; }; - dataViewEditor: { - openEditor: (options: DataViewEditorOptions) => () => void; - userPermissions: { - editDataView: () => boolean; - }; - }; } +/** + * An interface containing a collection of Kibana plugins and services required to + * render this component and its dependencies. + */ +export type KibanaNoDataPageKibanaDependencies = KibanaDependencies & + NoDataViewsPromptKibanaDependencies & + NoDataCardKibanaDependencies; /** * Props for `KibanaNoDataPage`. diff --git a/packages/shared-ux/page/kibana_template/impl/BUILD.bazel b/packages/shared-ux/page/kibana_template/impl/BUILD.bazel new file mode 100644 index 0000000000000..8e27df56eadf2 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/impl/BUILD.bazel @@ -0,0 +1,137 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "impl" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-kibana-template" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + "src/**/*.tsx", + "src/**/*.mdx", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ + "@npm//react", + "//packages/shared-ux/page/no_data_config/impl", +] + +# In this array place dependencies necessary to build the types, which will include the +# :npm_module_types target of other packages and packages from NPM, including @types/* +# packages. +# +# To reference the types for another package use: +# "//repo/relative/path/to/package:npm_module_types" +# eg. "//packages/kbn-utils:npm_module_types" +# +# References to NPM packages work the same as RUNTIME_DEPS +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/react", + "//packages/shared-ux/page/no_data_config/impl:npm_module_types", + "//packages/shared-ux/page/kibana_template/types", + "//packages/kbn-ambient-ui-types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, + additional_args = [ + "--copy-files", + "--quiet" + ], +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template.mdx b/packages/shared-ux/page/kibana_template/impl/README.mdx similarity index 97% rename from packages/kbn-shared-ux-components/src/page_template/page_template.mdx rename to packages/shared-ux/page/kibana_template/impl/README.mdx index fbaada158e277..6d8151cbe882c 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template.mdx +++ b/packages/shared-ux/page/kibana_template/impl/README.mdx @@ -1,6 +1,6 @@ --- id: sharedUX/Components/PageTemplate -slug: /shared-ux-components/page_template/page_template +slug: /shared-ux/page_template title: Page Template description: A Kibana-specific wrapper around `EuiTemplate` tags: ['shared-ux', 'component'] @@ -124,7 +124,7 @@ Increases the consistency in messaging across all the solutions during the getti This is a built-in configuration that displays a very specific UI and requires very specific keys. It will also ignore all other configurations of the template including `pageHeader` and `children`, with the exception of continuing to show `solutionNav`. -The `noDataConfig` is of type [`NoDataPageProps`](https://github.com/elastic/kibana/blob/main/packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts#L14): +The `noDataConfig` is of type [`NoDataPageProps`](https://github.com/elastic/kibana/blob/main/packages/shared-ux/page/no_data/types/index.d.ts): 1. `solution: string`: Single name for the current solution, used to auto-generate the title, logo, and description *(required)* 2. `docsLink: string`: Required to set the docs link for the whole solution *(required)* diff --git a/packages/shared-ux/card/no_data/mocks/jest.config.js b/packages/shared-ux/page/kibana_template/impl/jest.config.js similarity index 81% rename from packages/shared-ux/card/no_data/mocks/jest.config.js rename to packages/shared-ux/page/kibana_template/impl/jest.config.js index 2c7697ab74eb8..103defe0f0ca6 100644 --- a/packages/shared-ux/card/no_data/mocks/jest.config.js +++ b/packages/shared-ux/page/kibana_template/impl/jest.config.js @@ -7,7 +7,7 @@ */ module.exports = { - preset: '@kbn/test/jest_node', + preset: '@kbn/test', rootDir: '../../../../..', - roots: ['/packages/shared-ux/card/no_data/mocks'], + roots: ['/packages/shared-ux/page/kibana_template/impl'], }; diff --git a/packages/shared-ux/page/kibana_template/impl/package.json b/packages/shared-ux/page/kibana_template/impl/package.json new file mode 100644 index 0000000000000..a089481047999 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/impl/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/shared-ux-page-kibana-template", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-shared-ux-components/src/page_template/__snapshots__/page_template.test.tsx.snap b/packages/shared-ux/page/kibana_template/impl/src/__snapshots__/page_template.test.tsx.snap similarity index 100% rename from packages/kbn-shared-ux-components/src/page_template/__snapshots__/page_template.test.tsx.snap rename to packages/shared-ux/page/kibana_template/impl/src/__snapshots__/page_template.test.tsx.snap diff --git a/packages/kbn-shared-ux-components/src/page_template/__snapshots__/page_template_inner.test.tsx.snap b/packages/shared-ux/page/kibana_template/impl/src/__snapshots__/page_template_inner.test.tsx.snap similarity index 100% rename from packages/kbn-shared-ux-components/src/page_template/__snapshots__/page_template_inner.test.tsx.snap rename to packages/shared-ux/page/kibana_template/impl/src/__snapshots__/page_template_inner.test.tsx.snap diff --git a/packages/kbn-shared-ux-components/src/page_template/index.ts b/packages/shared-ux/page/kibana_template/impl/src/index.ts similarity index 60% rename from packages/kbn-shared-ux-components/src/page_template/index.ts rename to packages/shared-ux/page/kibana_template/impl/src/index.ts index cd7d6232d9a8b..9a890cafe49aa 100644 --- a/packages/kbn-shared-ux-components/src/page_template/index.ts +++ b/packages/shared-ux/page/kibana_template/impl/src/index.ts @@ -5,7 +5,12 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -export { NoDataPage, NoDataConfigPage } from './no_data_page'; + export { KibanaPageTemplate } from './page_template'; -export type { KibanaPageTemplateProps } from './types'; -export type { NoDataPageProps } from './no_data_page'; +export { KibanaPageTemplateProvider, KibanaPageTemplateKibanaProvider } from './services'; +export type { + NoDataConfig, + KibanaPageTemplateProps, + KibanaPageTemplateServices, + KibanaPageTemplateKibanaDependencies, +} from '@kbn/shared-ux-page-kibana-template-types'; diff --git a/packages/shared-ux/page/kibana_template/impl/src/page_template.stories.tsx b/packages/shared-ux/page/kibana_template/impl/src/page_template.stories.tsx new file mode 100644 index 0000000000000..91f46f4f89faa --- /dev/null +++ b/packages/shared-ux/page/kibana_template/impl/src/page_template.stories.tsx @@ -0,0 +1,82 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { + KibanaPageTemplateStorybookMock, + NoDataConfigStorybookMock, + SolutionNavStorybookMock, + InnerPageTemplateStorybookMock, +} from '@kbn/shared-ux-page-kibana-template-mocks'; +import type { + KibanaPageTemplateStorybookParams, + NoDataConfigStorybookParams, + SolutionNavStorybookParams, + InnerPageTemplateStorybookParams, +} from '@kbn/shared-ux-page-kibana-template-mocks'; + +import { KibanaPageTemplateProvider } from './services'; + +import { KibanaPageTemplate as Component } from './page_template'; +import mdx from '../README.mdx'; + +export default { + title: 'Page/Page Template', + description: + 'A thin wrapper around `EuiTemplate`. Takes care of styling, empty state and no data config', + parameters: { + docs: { + page: mdx, + }, + }, +}; + +const templateMock = new KibanaPageTemplateStorybookMock(); +const solutionNavMock = new SolutionNavStorybookMock(); +const noDataConfigMock = new NoDataConfigStorybookMock(); +const innerMock = new InnerPageTemplateStorybookMock(); + +export const WithNoDataConfig = (params: NoDataConfigStorybookParams) => { + return ( + + + + ); +}; + +WithNoDataConfig.argTypes = noDataConfigMock.getArgumentTypes(); + +export const WithSolutionNav = (params: SolutionNavStorybookParams) => { + return ( + + + + ); +}; + +WithSolutionNav.argTypes = solutionNavMock.getArgumentTypes(); + +export const WithBoth = (params: KibanaPageTemplateStorybookParams) => { + return ( + + + + ); +}; + +WithBoth.argTypes = templateMock.getArgumentTypes(); + +export const WithNeither = (params: InnerPageTemplateStorybookParams) => { + return ( + + + + ); +}; + +WithNeither.argTypes = innerMock.getArgumentTypes(); diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template.test.tsx b/packages/shared-ux/page/kibana_template/impl/src/page_template.test.tsx similarity index 97% rename from packages/kbn-shared-ux-components/src/page_template/page_template.test.tsx rename to packages/shared-ux/page/kibana_template/impl/src/page_template.test.tsx index 1324b60b92870..0e9df4b6c2394 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template.test.tsx +++ b/packages/shared-ux/page/kibana_template/impl/src/page_template.test.tsx @@ -9,9 +9,9 @@ import React from 'react'; import { shallow, render } from 'enzyme'; import { SolutionNavProps } from '@kbn/shared-ux-page-solution-nav'; +import type { NoDataPageProps } from '@kbn/shared-ux-page-no-data-types'; import { KibanaPageTemplate } from './page_template'; -import { NoDataPageProps } from './no_data_page'; const items: SolutionNavProps['items'] = [ { diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template.tsx b/packages/shared-ux/page/kibana_template/impl/src/page_template.tsx similarity index 82% rename from packages/kbn-shared-ux-components/src/page_template/page_template.tsx rename to packages/shared-ux/page/kibana_template/impl/src/page_template.tsx index 467f02224b0de..5a05315d395a7 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template.tsx +++ b/packages/shared-ux/page/kibana_template/impl/src/page_template.tsx @@ -6,13 +6,17 @@ * Side Public License, v 1. */ -import React, { FunctionComponent } from 'react'; +import React, { FC } from 'react'; + +import { + NoDataConfigPage, + NoDataConfigPageWithSolutionNavBar, +} from '@kbn/shared-ux-page-no-data-config'; +import { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template-types'; -import { NoDataConfigPage, NoDataConfigPageWithSolutionNavBar } from './no_data_page'; import { KibanaPageTemplateInner, KibanaPageTemplateWithSolutionNav } from './page_template_inner'; -import { KibanaPageTemplateProps } from './types'; -export const KibanaPageTemplate: FunctionComponent = ({ +export const KibanaPageTemplate: FC = ({ template, className, children, diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template_inner.test.tsx b/packages/shared-ux/page/kibana_template/impl/src/page_template_inner.test.tsx similarity index 100% rename from packages/kbn-shared-ux-components/src/page_template/page_template_inner.test.tsx rename to packages/shared-ux/page/kibana_template/impl/src/page_template_inner.test.tsx diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template_inner.tsx b/packages/shared-ux/page/kibana_template/impl/src/page_template_inner.tsx similarity index 81% rename from packages/kbn-shared-ux-components/src/page_template/page_template_inner.tsx rename to packages/shared-ux/page/kibana_template/impl/src/page_template_inner.tsx index 46424348f2ff3..6d836a3c66d7f 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template_inner.tsx +++ b/packages/shared-ux/page/kibana_template/impl/src/page_template_inner.tsx @@ -6,20 +6,25 @@ * Side Public License, v 1. */ -import React, { FunctionComponent } from 'react'; - +import React, { FC } from 'react'; +import classNames from 'classnames'; import { EuiEmptyPrompt, EuiPageTemplate } from '@elastic/eui'; -import { withSolutionNav } from '@kbn/shared-ux-page-solution-nav'; -import { KibanaPageTemplateProps } from './types'; -import { getClasses } from './util'; +import { withSolutionNav } from '@kbn/shared-ux-page-solution-nav'; +import { KibanaPageTemplateProps as Props } from '@kbn/shared-ux-page-kibana-template-types'; -type Props = KibanaPageTemplateProps; +const getClasses = (template?: string, className?: string) => { + return classNames( + 'kbnPageTemplate', + template ? { [`kbnPageTemplate--${template}`]: template } : '', + className || '' + ); +}; /** * A thin wrapper around EuiPageTemplate with a few Kibana specific additions */ -export const KibanaPageTemplateInner: FunctionComponent = ({ +export const KibanaPageTemplateInner: FC = ({ template, className, pageHeader, diff --git a/packages/shared-ux/page/kibana_template/impl/src/services.tsx b/packages/shared-ux/page/kibana_template/impl/src/services.tsx new file mode 100644 index 0000000000000..328d3e8a6f9c8 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/impl/src/services.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, { FC } from 'react'; + +import { + NoDataConfigPageProvider, + NoDataConfigPageKibanaProvider, +} from '@kbn/shared-ux-page-no-data-config'; + +import { + KibanaPageTemplateServices, + KibanaPageTemplateKibanaDependencies, +} from '@kbn/shared-ux-page-kibana-template-types'; + +/** + * A Context Provider that provides services to the component and its dependencies. + */ +export const KibanaPageTemplateProvider: FC = ({ + children, + ...services +}) => { + return {children}; +}; + +/** + * Kibana-specific Provider that maps dependencies to services. + */ +export const KibanaPageTemplateKibanaProvider: FC = ({ + children, + ...dependencies +}) => { + return ( + {children} + ); +}; diff --git a/packages/shared-ux/page/kibana_template/impl/tsconfig.json b/packages/shared-ux/page/kibana_template/impl/tsconfig.json new file mode 100644 index 0000000000000..6b965878dca79 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/impl/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": ".", + "stripInternal": false, + "types": [ + "jest", + "node", + "@kbn/ambient-ui-types", + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel b/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel new file mode 100644 index 0000000000000..0680dd91e867f --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel @@ -0,0 +1,144 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "mocks" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-kibana-template-mocks" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + "src/**/*.tsx", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ + "@npm//lodash", + "@npm//react", + "//packages/shared-ux/page/no_data_config/mocks", + "//packages/shared-ux/storybook/mock", +] + +# In this array place dependencies necessary to build the types, which will include the +# :npm_module_types target of other packages and packages from NPM, including @types/* +# packages. +# +# To reference the types for another package use: +# "//repo/relative/path/to/package:npm_module_types" +# eg. "//packages/kbn-utils:npm_module_types" +# +# References to NPM packages work the same as RUNTIME_DEPS +TYPES_DEPS = [ + "@npm//@types/jest", + "@npm//@types/lodash", + "@npm//@types/node", + "@npm//@types/react", + "//packages/shared-ux/page/kibana_template/types", + "//packages/shared-ux/page/no_data_config/mocks:npm_module_types", + "//packages/shared-ux/storybook/mock:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/kibana_template/mocks/README.mdx b/packages/shared-ux/page/kibana_template/mocks/README.mdx new file mode 100644 index 0000000000000..7515ff010ac90 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/README.mdx @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-kibana-template-mocks + +Empty package generated by @kbn/generate diff --git a/packages/shared-ux/page/kibana_template/mocks/package.json b/packages/shared-ux/page/kibana_template/mocks/package.json new file mode 100644 index 0000000000000..c6dc7b5671d7e --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/shared-ux-page-kibana-template-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_template/mocks/src/index.ts b/packages/shared-ux/page/kibana_template/mocks/src/index.ts new file mode 100644 index 0000000000000..c2193c9c89e61 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/index.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may 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 { + getServicesMock as getKibanaPageTemplateServicesMock, + getKibanaDependenciesMock as getKibanaPageTemplateKibanaDependenciesMock, +} from './jest'; + +export { + KibanaPageTemplateStorybookMock, + NoDataConfigStorybookMock, + SolutionNavStorybookMock, + InnerPageTemplateStorybookMock, +} from './storybook'; + +export type { + KibanaPageTemplateStorybookParams, + NoDataConfigStorybookParams, + SolutionNavStorybookParams, + InnerPageTemplateStorybookParams, +} from './storybook'; diff --git a/packages/shared-ux/page/kibana_template/mocks/src/jest.ts b/packages/shared-ux/page/kibana_template/mocks/src/jest.ts new file mode 100644 index 0000000000000..5f260e194f6d8 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/jest.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 { getNoDataCardKibanaDependenciesMock } from '@kbn/shared-ux-card-no-data-mocks'; +import type { + KibanaPageTemplateServices, + KibanaPageTemplateKibanaDependencies, +} from '@kbn/shared-ux-page-kibana-template-types'; +import { getNoDataConfigPageServicesMock } from '@kbn/shared-ux-page-no-data-config-mocks'; + +export const getServicesMock = () => { + const services: KibanaPageTemplateServices = { + ...getNoDataConfigPageServicesMock(), + }; + + return services; +}; + +export const getKibanaDependenciesMock = () => { + const dependencies: KibanaPageTemplateKibanaDependencies = { + ...getNoDataCardKibanaDependenciesMock(), + }; + + return dependencies; +}; diff --git a/packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts b/packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts new file mode 100644 index 0000000000000..6a5754ba1862b --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/storybook/all.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 { AbstractStorybookMock } from '@kbn/shared-ux-storybook-mock'; +import type { ArgumentParams } from '@kbn/shared-ux-storybook-mock'; + +import { NoDataConfigPageStorybookMock } from '@kbn/shared-ux-page-no-data-config-mocks'; +import type { NoDataConfigPageStorybookParams } from '@kbn/shared-ux-page-no-data-config-mocks'; + +import type { + KibanaPageTemplateProps, + KibanaPageTemplateServices, +} from '@kbn/shared-ux-page-kibana-template-types'; + +import { noDataConfigArguments } from './no_data_config'; +import type { NoDataConfigArguments } from './no_data_config'; +import { solutionNavArguments, solutionNavProps } from './solution_nav'; +import type { SolutionNavArguments } from './solution_nav'; + +type PropArguments = NoDataConfigArguments & SolutionNavArguments; + +export type Params = ArgumentParams & NoDataConfigPageStorybookParams; + +const noDataConfigMock = new NoDataConfigPageStorybookMock(); + +export class StorybookMock extends AbstractStorybookMock< + KibanaPageTemplateProps, + KibanaPageTemplateServices, + PropArguments +> { + propArguments = { + ...noDataConfigArguments, + ...solutionNavArguments, + }; + + serviceArguments = {}; + + dependencies = [noDataConfigMock]; + + getProps(params?: Params): KibanaPageTemplateProps { + const result: KibanaPageTemplateProps = { + noDataConfig: { + action: { + elasticAgent: { + title: 'Add Integrations', + }, + }, + solution: this.getArgumentValue('solution', params), + logo: this.getArgumentValue('logo', params), + docsLink: this.getArgumentValue('docsLink', params), + pageTitle: this.getArgumentValue('pageTitle', params), + }, + solutionNav: { + name: this.getArgumentValue('name', params), + icon: this.getArgumentValue('icon', params), + canBeCollapsed: this.getArgumentValue('canBeCollapsed', params), + ...solutionNavProps, + }, + }; + + return result; + } + + getServices(params: Params): KibanaPageTemplateServices { + return { ...noDataConfigMock.getServices(params) }; + } +} diff --git a/packages/shared-ux/page/kibana_template/mocks/src/storybook/index.ts b/packages/shared-ux/page/kibana_template/mocks/src/storybook/index.ts new file mode 100644 index 0000000000000..ecbc26c20a095 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/storybook/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { StorybookMock as NoDataConfigStorybookMock } from './no_data_config'; +export type { Params as NoDataConfigStorybookParams } from './no_data_config'; + +export { StorybookMock as SolutionNavStorybookMock } from './solution_nav'; +export type { Params as SolutionNavStorybookParams } from './solution_nav'; + +export { StorybookMock as KibanaPageTemplateStorybookMock } from './all'; +export type { Params as KibanaPageTemplateStorybookParams } from './all'; + +export { StorybookMock as InnerPageTemplateStorybookMock } from './inner'; +export type { Params as InnerPageTemplateStorybookParams } from './inner'; diff --git a/packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx b/packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx new file mode 100644 index 0000000000000..7794aea021b89 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx @@ -0,0 +1,94 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { AbstractStorybookMock } from '@kbn/shared-ux-storybook-mock'; +import type { ArgumentParams } from '@kbn/shared-ux-storybook-mock'; + +import { NoDataConfigPageStorybookMock } from '@kbn/shared-ux-page-no-data-config-mocks'; +import type { NoDataConfigPageStorybookParams } from '@kbn/shared-ux-page-no-data-config-mocks'; + +import type { + KibanaPageTemplateProps, + KibanaPageTemplateServices, +} from '@kbn/shared-ux-page-kibana-template-types'; + +type PageHeader = NonNullable; +export type PageHeaderArguments = Pick< + PageHeader, + 'iconType' | 'pageTitle' | 'description' | 'rightSideItems' +>; + +type PropArguments = Pick & PageHeaderArguments; + +export type Params = ArgumentParams & NoDataConfigPageStorybookParams; + +const noDataConfigMock = new NoDataConfigPageStorybookMock(); + +export const pageHeaderArguments: ArgumentParams = { + isEmptyState: { + control: 'boolean', + defaultValue: false, + }, + iconType: { + control: { type: 'radio' }, + options: ['logoElastic', 'logoKibana', 'logoCloud', undefined], + defaultValue: undefined, + }, + pageTitle: { + control: 'text', + defaultValue: 'Page title', + }, + description: { + control: 'text', + defaultValue: 'Page description', + }, + rightSideItems: { + control: 'boolean', + defaultValue: true, + }, +}; + +const rightSideItems: PageHeaderArguments['rightSideItems'] = [ + First Item, + Second Item, +]; + +export class StorybookMock extends AbstractStorybookMock< + KibanaPageTemplateProps, + KibanaPageTemplateServices, + PropArguments +> { + propArguments = { + ...pageHeaderArguments, + }; + + serviceArguments = {}; + + dependencies = []; + + getProps(params?: Params): KibanaPageTemplateProps { + const result: KibanaPageTemplateProps = { + isEmptyState: this.getArgumentValue('isEmptyState', params), + pageHeader: { + iconType: this.getArgumentValue('iconType', params), + pageTitle: this.getArgumentValue('pageTitle', params), + description: this.getArgumentValue('description', params), + rightSideItems: this.getArgumentValue('rightSideItems', params) + ? rightSideItems + : undefined, + }, + }; + + return result; + } + + getServices(params: Params): KibanaPageTemplateServices { + return { ...noDataConfigMock.getServices(params) }; + } +} diff --git a/packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts b/packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts new file mode 100644 index 0000000000000..92e7f0da52e62 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.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 { AbstractStorybookMock } from '@kbn/shared-ux-storybook-mock'; +import type { ArgumentParams } from '@kbn/shared-ux-storybook-mock'; + +import { NoDataConfigPageStorybookMock } from '@kbn/shared-ux-page-no-data-config-mocks'; +import type { NoDataConfigPageStorybookParams } from '@kbn/shared-ux-page-no-data-config-mocks'; + +import type { + NoDataConfig, + KibanaPageTemplateProps, + KibanaPageTemplateServices, +} from '@kbn/shared-ux-page-kibana-template-types'; + +export type NoDataConfigArguments = Pick< + NoDataConfig, + 'solution' | 'logo' | 'docsLink' | 'pageTitle' +>; + +type PropArguments = NoDataConfigArguments; + +export type Params = ArgumentParams & NoDataConfigPageStorybookParams; + +const noDataConfigMock = new NoDataConfigPageStorybookMock(); + +export const noDataConfigArguments: ArgumentParams = { + solution: { + control: 'text', + defaultValue: 'Observability', + }, + logo: { + control: { type: 'radio' }, + options: ['logoElastic', 'logoKibana', 'logoCloud', undefined], + defaultValue: undefined, + }, + docsLink: { + control: 'text', + defaultValue: 'docs/link', + }, + pageTitle: { + control: 'text', + defaultValue: '', + }, +}; + +export class StorybookMock extends AbstractStorybookMock< + KibanaPageTemplateProps, + KibanaPageTemplateServices, + PropArguments +> { + propArguments = { + ...noDataConfigArguments, + }; + + serviceArguments = {}; + + dependencies = [noDataConfigMock]; + + getProps(params?: Params): KibanaPageTemplateProps { + const result: KibanaPageTemplateProps = { + noDataConfig: { + action: { + elasticAgent: { + title: 'Add Integrations', + }, + }, + solution: this.getArgumentValue('solution', params), + logo: this.getArgumentValue('logo', params), + docsLink: this.getArgumentValue('docsLink', params), + pageTitle: this.getArgumentValue('pageTitle', params), + }, + }; + + return result; + } + + getServices(params: Params): KibanaPageTemplateServices { + return { ...noDataConfigMock.getServices(params) }; + } +} diff --git a/packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts b/packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts new file mode 100644 index 0000000000000..3590a3e896a2e --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts @@ -0,0 +1,115 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AbstractStorybookMock } from '@kbn/shared-ux-storybook-mock'; +import type { ArgumentParams } from '@kbn/shared-ux-storybook-mock'; + +import { NoDataConfigPageStorybookMock } from '@kbn/shared-ux-page-no-data-config-mocks'; +import type { NoDataConfigPageStorybookParams } from '@kbn/shared-ux-page-no-data-config-mocks'; + +import type { + KibanaPageTemplateProps, + KibanaPageTemplateServices, +} from '@kbn/shared-ux-page-kibana-template-types'; + +type SolutionNav = NonNullable; +export type SolutionNavArguments = Pick; + +type PropArguments = SolutionNavArguments; + +export type Params = ArgumentParams & NoDataConfigPageStorybookParams; + +const noDataConfigMock = new NoDataConfigPageStorybookMock(); + +export const solutionNavArguments: ArgumentParams = { + name: { + control: 'text', + defaultValue: 'Kibana', + }, + icon: { + control: { type: 'radio' }, + options: ['logoKibana', 'logoObservability', 'logoSecurity'], + defaultValue: 'logoKibana', + }, + canBeCollapsed: { + control: 'boolean', + defaultValue: true, + }, +}; + +export const solutionNavProps = { + items: [ + { + name: 'Ingest', + id: '1', + items: [ + { + name: 'Ingest Node Pipelines', + id: '1.1', + }, + { + name: 'Logstash Pipelines', + id: '1.2', + }, + { + name: 'Beats Central Management', + id: '1.3', + }, + ], + }, + { + name: 'Data', + id: '2', + items: [ + { + name: 'Index Management', + id: '2.1', + }, + { + name: 'Index Lifecycle Policies', + id: '2.2', + }, + { + name: 'Snapshot and Restore', + id: '2.3', + }, + ], + }, + ], +}; + +export class StorybookMock extends AbstractStorybookMock< + KibanaPageTemplateProps, + KibanaPageTemplateServices, + PropArguments +> { + propArguments = { + ...solutionNavArguments, + }; + + serviceArguments = {}; + + dependencies = [noDataConfigMock]; + + getProps(params?: Params): KibanaPageTemplateProps { + const result: KibanaPageTemplateProps = { + solutionNav: { + name: this.getArgumentValue('name', params), + icon: this.getArgumentValue('icon', params), + canBeCollapsed: this.getArgumentValue('canBeCollapsed', params), + ...solutionNavProps, + }, + }; + + return result; + } + + getServices(params: Params): KibanaPageTemplateServices { + return { ...noDataConfigMock.getServices(params) }; + } +} diff --git a/packages/shared-ux/page/kibana_template/mocks/tsconfig.json b/packages/shared-ux/page/kibana_template/mocks/tsconfig.json new file mode 100644 index 0000000000000..dc96ec41f9035 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ] +} diff --git a/packages/shared-ux/page/kibana_template/types/BUILD.bazel b/packages/shared-ux/page/kibana_template/types/BUILD.bazel new file mode 100644 index 0000000000000..45cbd0fd4cc42 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/types/BUILD.bazel @@ -0,0 +1,59 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "types" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-kibana-template-types" + +SRCS = glob( + [ + "*.d.ts", + ] +) + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ +] + +js_library( + name = PKG_DIRNAME, + srcs = SRCS + NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS, + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +alias( + name = "npm_module_types", + actual = ":" + PKG_DIRNAME, + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/kibana_template/types/README.mdx b/packages/shared-ux/page/kibana_template/types/README.mdx new file mode 100644 index 0000000000000..8245f7d8d8c21 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/types/README.mdx @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-kibana-template-types + +Empty package generated by @kbn/generate diff --git a/packages/kbn-shared-ux-components/src/page_template/types.ts b/packages/shared-ux/page/kibana_template/types/index.d.ts similarity index 74% rename from packages/kbn-shared-ux-components/src/page_template/types.ts rename to packages/shared-ux/page/kibana_template/types/index.d.ts index 6a8b0d583ed18..8f3129c31817d 100644 --- a/packages/kbn-shared-ux-components/src/page_template/types.ts +++ b/packages/shared-ux/page/kibana_template/types/index.d.ts @@ -9,7 +9,15 @@ import { EuiPageTemplateProps } from '@elastic/eui'; import { SolutionNavProps } from '@kbn/shared-ux-page-solution-nav'; -import { NoDataPageProps } from './no_data_page'; +import { + NoDataConfig, + NoDataConfigPageServices, + NoDataConfigPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-config-types'; + +export type KibanaPageTemplateKibanaDependencies = NoDataConfigPageKibanaDependencies; +export type KibanaPageTemplateServices = NoDataConfigPageServices; +export type { NoDataConfig } from '@kbn/shared-ux-page-no-data-config-types'; export type KibanaPageTemplateProps = EuiPageTemplateProps & { /** @@ -27,5 +35,5 @@ export type KibanaPageTemplateProps = EuiPageTemplateProps & { * Accepts a configuration object, that when provided, ignores pageHeader and children and instead * displays Agent, Beats, and custom cards to direct users to the right ingest location */ - noDataConfig?: NoDataPageProps; + noDataConfig?: NoDataConfig; }; diff --git a/packages/shared-ux/page/kibana_template/types/package.json b/packages/shared-ux/page/kibana_template/types/package.json new file mode 100644 index 0000000000000..4562e9a1becdd --- /dev/null +++ b/packages/shared-ux/page/kibana_template/types/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/shared-ux-page-kibana-template-types", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_template/types/tsconfig.json b/packages/shared-ux/page/kibana_template/types/tsconfig.json new file mode 100644 index 0000000000000..7a4adfcdbecff --- /dev/null +++ b/packages/shared-ux/page/kibana_template/types/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "stripInternal": false, + "types": [] + }, + "include": [ + "*.d.ts" + ] +} diff --git a/packages/kbn-shared-ux-components/BUILD.bazel b/packages/shared-ux/page/no_data/impl/BUILD.bazel similarity index 75% rename from packages/kbn-shared-ux-components/BUILD.bazel rename to packages/shared-ux/page/no_data/impl/BUILD.bazel index 74924f4c6519d..13ffd0694bdd2 100644 --- a/packages/kbn-shared-ux-components/BUILD.bazel +++ b/packages/shared-ux/page/no_data/impl/BUILD.bazel @@ -2,19 +2,17 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_DIRNAME = "kbn-shared-ux-components" -PKG_REQUIRE_NAME = "@kbn/shared-ux-components" +PKG_DIRNAME = "impl" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data" SOURCE_FILES = glob( [ "src/**/*.ts", "src/**/*.tsx", - "src/**/*.scss", - "src/**/*.mdx", - "src/**/*.svg", ], exclude = [ "**/*.test.*", + "**/*.stories.*", ], ) @@ -41,22 +39,10 @@ NPM_MODULE_EXTRA_FILES = [ # eg. "@npm//lodash" RUNTIME_DEPS = [ "@npm//@elastic/eui", - "@npm//@emotion/css", - "@npm//@emotion/react", "@npm//classnames", - "@npm//react-use", "@npm//react", - "@npm//rxjs", - "@npm//url-loader", - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "//packages/kbn-shared-ux-services", - "//packages/kbn-shared-ux-storybook", - "//packages/kbn-shared-ux-utility", "//packages/shared-ux/avatar/solution", "//packages/shared-ux/card/no_data/impl", - "//packages/shared-ux/link/redirect_app/impl", - "//packages/shared-ux/page/solution_nav", "//packages/shared-ux/prompt/no_data_views/impl", ] @@ -71,24 +57,14 @@ RUNTIME_DEPS = [ # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ "@npm//@elastic/eui", - "@npm//@emotion/css", - "@npm//@emotion/react", "@npm//@types/classnames", "@npm//@types/jest", "@npm//@types/node", "@npm//@types/react", - "@npm//react-use", - "@npm//rxjs", "//packages/kbn-ambient-ui-types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-shared-ux-services:npm_module_types", - "//packages/kbn-shared-ux-storybook:npm_module_types", - "//packages/kbn-shared-ux-utility:npm_module_types", "//packages/shared-ux/avatar/solution:npm_module_types", "//packages/shared-ux/card/no_data/impl:npm_module_types", - "//packages/shared-ux/link/redirect_app/impl:npm_module_types", - "//packages/shared-ux/page/solution_nav:npm_module_types", + "//packages/shared-ux/page/no_data/types:npm_module_types", "//packages/shared-ux/prompt/no_data_views/impl:npm_module_types", ] diff --git a/packages/shared-ux/page/no_data/impl/README.mdx b/packages/shared-ux/page/no_data/impl/README.mdx new file mode 100644 index 0000000000000..e5dd8c235c4ce --- /dev/null +++ b/packages/shared-ux/page/no_data/impl/README.mdx @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-no-data + +Empty package generated by @kbn/generate diff --git a/packages/kbn-shared-ux-components/jest.config.js b/packages/shared-ux/page/no_data/impl/jest.config.js similarity index 81% rename from packages/kbn-shared-ux-components/jest.config.js rename to packages/shared-ux/page/no_data/impl/jest.config.js index c2ac8c3a57106..1b7ff2aafe740 100644 --- a/packages/kbn-shared-ux-components/jest.config.js +++ b/packages/shared-ux/page/no_data/impl/jest.config.js @@ -8,6 +8,6 @@ module.exports = { preset: '@kbn/test', - rootDir: '../..', - roots: ['/packages/kbn-shared-ux-components'], + rootDir: '../../../../..', + roots: ['/packages/shared-ux/page/no_data/impl'], }; diff --git a/packages/kbn-shared-ux-components/package.json b/packages/shared-ux/page/no_data/impl/package.json similarity index 80% rename from packages/kbn-shared-ux-components/package.json rename to packages/shared-ux/page/no_data/impl/package.json index 948df7fadd712..1f09f616a765f 100644 --- a/packages/kbn-shared-ux-components/package.json +++ b/packages/shared-ux/page/no_data/impl/package.json @@ -1,5 +1,5 @@ { - "name": "@kbn/shared-ux-components", + "name": "@kbn/shared-ux-page-no-data", "private": true, "version": "1.0.0", "main": "./target_node/index.js", diff --git a/packages/shared-ux/page/no_data/impl/src/action_card.tsx b/packages/shared-ux/page/no_data/impl/src/action_card.tsx new file mode 100644 index 0000000000000..0dec8c677b12c --- /dev/null +++ b/packages/shared-ux/page/no_data/impl/src/action_card.tsx @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { NoDataCard, NoDataCardProps } from '@kbn/shared-ux-card-no-data'; +import { ActionCardProps } from '@kbn/shared-ux-page-no-data-types'; + +export type NoDataPageActions = NoDataCardProps; + +export const KEY_ELASTIC_AGENT = 'elasticAgent'; + +export const ActionCard = ({ action }: ActionCardProps) => { + const actionKeys = Object.keys(action); + + if (actionKeys.length !== 1) { + return null; + } + + const actionKey = actionKeys[0]; + const key = + actionKey === KEY_ELASTIC_AGENT ? 'empty-page-agent-action' : `empty-page-${actionKey}-action`; + + return ; +}; diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/index.ts b/packages/shared-ux/page/no_data/impl/src/index.ts similarity index 65% rename from packages/kbn-shared-ux-components/src/page_template/no_data_page/index.ts rename to packages/shared-ux/page/no_data/impl/src/index.ts index a6f8c91f7614c..5438612b541bd 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/index.ts +++ b/packages/shared-ux/page/no_data/impl/src/index.ts @@ -7,5 +7,10 @@ */ export { NoDataPage } from './no_data_page'; -export type { NoDataPageProps } from './types'; -export { NoDataConfigPage, NoDataConfigPageWithSolutionNavBar } from './no_data_config_page'; +export type { + NoDataPageProps, + NoDataPageServices, + NoDataPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-types'; + +export { NoDataPageKibanaProvider, NoDataPageProvider } from './services'; diff --git a/packages/shared-ux/page/no_data/impl/src/no_data_page.stories.tsx b/packages/shared-ux/page/no_data/impl/src/no_data_page.stories.tsx new file mode 100644 index 0000000000000..6b56a44638358 --- /dev/null +++ b/packages/shared-ux/page/no_data/impl/src/no_data_page.stories.tsx @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; + +import { NoDataPageStorybookMock } from '@kbn/shared-ux-page-no-data-mocks'; +import type { NoDataPageStorybookParams } from '@kbn/shared-ux-page-no-data-mocks'; + +import { NoDataPage as Component } from './no_data_page'; + +import { NoDataPageProvider } from './services'; +import mdx from '../README.mdx'; + +const mock = new NoDataPageStorybookMock(); + +export default { + title: 'No Data/Page/No Data Page', + description: 'A component to display when there is no data available', + parameters: { + docs: { + page: mdx, + }, + }, +}; + +export const NoDataPage = (params: NoDataPageStorybookParams) => { + return ( + + + + ); +}; + +NoDataPage.argTypes = mock.getArgumentTypes(); diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_page.test.tsx b/packages/shared-ux/page/no_data/impl/src/no_data_page.test.tsx similarity index 81% rename from packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_page.test.tsx rename to packages/shared-ux/page/no_data/impl/src/no_data_page.test.tsx index b9474285469e1..576cf4f3b7230 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_page.test.tsx +++ b/packages/shared-ux/page/no_data/impl/src/no_data_page.test.tsx @@ -9,14 +9,15 @@ import React from 'react'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import { NoDataCard } from '@kbn/shared-ux-card-no-data'; -import { SharedUxServicesProvider, mockServicesFactory } from '@kbn/shared-ux-services'; +import { getNoDataPageServicesMock } from '@kbn/shared-ux-page-no-data-mocks'; import { NoDataPage } from './no_data_page'; +import { NoDataPageProvider } from './services'; describe('NoDataPage', () => { test('render', () => { const component = mountWithIntl( - + { logo={'logoKibana'} docsLink="test" /> - + ); expect(component.find('h1').html()).toContain('Welcome to Elastic Analytics!'); expect(component.find(NoDataCard).length).toBe(1); diff --git a/packages/shared-ux/page/no_data/impl/src/no_data_page.tsx b/packages/shared-ux/page/no_data/impl/src/no_data_page.tsx new file mode 100644 index 0000000000000..1bc93123aea95 --- /dev/null +++ b/packages/shared-ux/page/no_data/impl/src/no_data_page.tsx @@ -0,0 +1,67 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import classNames from 'classnames'; + +import { EuiLink, EuiSpacer, EuiText, EuiTextColor } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import { KibanaSolutionAvatar } from '@kbn/shared-ux-avatar-solution'; +import type { NoDataPageProps } from '@kbn/shared-ux-page-no-data-types'; + +import { ActionCard } from './action_card'; + +export const NoDataPage = ({ + solution, + logo, + action, + docsLink, + pageTitle, + className, +}: NoDataPageProps) => { + const title = + pageTitle || + i18n.translate('sharedUXPackages.noDataPage.welcomeTitle', { + defaultMessage: 'Welcome to Elastic {solution}!', + values: { solution }, + }); + + const link = ( + + + + ); + + const message = ( + + ); + + return ( +
+ + + +

{title}

+ +

{message}

+
+
+ + +
+ ); +}; diff --git a/packages/shared-ux/page/no_data/impl/src/services.tsx b/packages/shared-ux/page/no_data/impl/src/services.tsx new file mode 100644 index 0000000000000..3d10cc5547c92 --- /dev/null +++ b/packages/shared-ux/page/no_data/impl/src/services.tsx @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { FC } from 'react'; + +import { NoDataCardKibanaProvider, NoDataCardProvider } from '@kbn/shared-ux-card-no-data'; + +import type { + NoDataPageServices, + NoDataPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-types'; + +/** + * A Context Provider that provides services to the component and its dependencies. + */ +export const NoDataPageProvider: FC = ({ children, ...services }) => { + return {children}; +}; + +/** + * Kibana-specific Provider that maps dependencies to services. + */ +export const NoDataPageKibanaProvider: FC = ({ + children, + ...dependencies +}) => { + return {children}; +}; diff --git a/packages/kbn-shared-ux-components/tsconfig.json b/packages/shared-ux/page/no_data/impl/tsconfig.json similarity index 79% rename from packages/kbn-shared-ux-components/tsconfig.json rename to packages/shared-ux/page/no_data/impl/tsconfig.json index dd55bdb28a632..40ed24ecac4d2 100644 --- a/packages/kbn-shared-ux-components/tsconfig.json +++ b/packages/shared-ux/page/no_data/impl/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, @@ -10,7 +10,7 @@ "types": [ "jest", "node", - "@emotion/react/types/css-prop", + "react", "@kbn/ambient-ui-types", ] }, diff --git a/packages/shared-ux/page/no_data/mocks/BUILD.bazel b/packages/shared-ux/page/no_data/mocks/BUILD.bazel new file mode 100644 index 0000000000000..9296b28ed96f1 --- /dev/null +++ b/packages/shared-ux/page/no_data/mocks/BUILD.bazel @@ -0,0 +1,141 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "mocks" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-mocks" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ + "@npm//react", + "//packages/shared-ux/card/no_data/mocks", + "//packages/shared-ux/storybook/mock", +] + +# In this array place dependencies necessary to build the types, which will include the +# :npm_module_types target of other packages and packages from NPM, including @types/* +# packages. +# +# To reference the types for another package use: +# "//repo/relative/path/to/package:npm_module_types" +# eg. "//packages/kbn-utils:npm_module_types" +# +# References to NPM packages work the same as RUNTIME_DEPS +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/react", + "//packages/shared-ux/page/no_data/types", + "//packages/shared-ux/card/no_data/mocks:npm_module_types", + "//packages/shared-ux/storybook/mock:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/no_data/mocks/README.md b/packages/shared-ux/page/no_data/mocks/README.md new file mode 100644 index 0000000000000..5714e473d1f0c --- /dev/null +++ b/packages/shared-ux/page/no_data/mocks/README.md @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-no-data-mocks + +Empty package generated by @kbn/generate diff --git a/packages/shared-ux/page/no_data/mocks/package.json b/packages/shared-ux/page/no_data/mocks/package.json new file mode 100644 index 0000000000000..d6051a988cdc4 --- /dev/null +++ b/packages/shared-ux/page/no_data/mocks/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/shared-ux-page-no-data-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/src/plugins/shared_ux/common/index.ts b/packages/shared-ux/page/no_data/mocks/src/index.ts old mode 100755 new mode 100644 similarity index 56% rename from src/plugins/shared_ux/common/index.ts rename to packages/shared-ux/page/no_data/mocks/src/index.ts index 92dee001d9012..a17ff47a67775 --- a/src/plugins/shared_ux/common/index.ts +++ b/packages/shared-ux/page/no_data/mocks/src/index.ts @@ -6,8 +6,10 @@ * Side Public License, v 1. */ -/** The ID of the Shared UX plugin. */ -export const PLUGIN_ID = 'sharedUX'; +export { + getServicesMock as getNoDataPageServicesMock, + getKibanaDependenciesMock as getNoDataPageKibanaDependenciesMock, +} from './jest'; -/** The name of the Shared UX plugin. */ -export const PLUGIN_NAME = 'sharedUX'; +export { NoDataPageStorybookMock } from './storybook'; +export type { Params as NoDataPageStorybookParams } from './storybook'; diff --git a/packages/shared-ux/page/no_data/mocks/src/jest.ts b/packages/shared-ux/page/no_data/mocks/src/jest.ts new file mode 100644 index 0000000000000..fd44142c2f597 --- /dev/null +++ b/packages/shared-ux/page/no_data/mocks/src/jest.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 deepmerge from 'deepmerge'; +import { isPlainObject } from 'lodash'; + +import type { + NoDataPageServices, + NoDataPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-types'; + +import { + getNoDataCardServicesMock, + getNoDataCardKibanaDependenciesMock, +} from '@kbn/shared-ux-card-no-data-mocks'; + +const defaultParams = { + canAccessFleet: true, +}; + +export const getServicesMock = (params: Partial = defaultParams) => { + const canAccessFleet = + params.canAccessFleet !== undefined ? params.canAccessFleet : defaultParams.canAccessFleet; + + const services: NoDataPageServices = { + ...getNoDataCardServicesMock(), + canAccessFleet, + }; + + return services; +}; + +/** + * Return a Jest mock of the Kibana dependencies for the `NoDataPageKibanaProvider`. + */ +export const getKibanaDependenciesMock = ( + params: Partial = defaultParams +): NoDataPageKibanaDependencies => { + const integrations = + params.canAccessFleet !== undefined ? params.canAccessFleet : defaultParams.canAccessFleet; + + return deepmerge( + { + coreStart: { + application: { + capabilities: { + navLinks: { + integrations, + }, + }, + }, + }, + }, + getNoDataCardKibanaDependenciesMock(), + { + isMergeableObject: isPlainObject, + } + ); +}; diff --git a/packages/shared-ux/page/no_data/mocks/src/storybook.ts b/packages/shared-ux/page/no_data/mocks/src/storybook.ts new file mode 100644 index 0000000000000..899ddf819a7d6 --- /dev/null +++ b/packages/shared-ux/page/no_data/mocks/src/storybook.ts @@ -0,0 +1,67 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AbstractStorybookMock } from '@kbn/shared-ux-storybook-mock'; +import type { ArgumentParams } from '@kbn/shared-ux-storybook-mock'; +import type { NoDataPageProps, NoDataPageServices } from '@kbn/shared-ux-page-no-data-types'; +import { NoDataCardStorybookMock } from '@kbn/shared-ux-card-no-data-mocks'; +import type { NoDataCardStorybookParams } from '@kbn/shared-ux-card-no-data-mocks'; + +type PropArguments = Pick; + +export type Params = ArgumentParams & NoDataCardStorybookParams; + +const dataCardMock = new NoDataCardStorybookMock(); + +export class NoDataPageStorybookMock extends AbstractStorybookMock< + NoDataPageProps, + NoDataPageServices, + PropArguments +> { + propArguments = { + solution: { + control: 'text', + defaultValue: 'Observability', + }, + logo: { + control: { type: 'radio' }, + options: ['logoElastic', 'logoKibana', 'logoCloud', undefined], + defaultValue: undefined, + }, + docsLink: { + control: 'text', + defaultValue: 'docs/link', + }, + pageTitle: { + control: 'text', + defaultValue: '', + }, + }; + + serviceArguments = {}; + + dependencies = [dataCardMock]; + + getProps(params?: Params): NoDataPageProps { + return { + action: { + elasticAgent: { + title: 'Add Integrations', + }, + }, + solution: this.getArgumentValue('solution', params), + logo: this.getArgumentValue('logo', params), + docsLink: this.getArgumentValue('docsLink', params), + pageTitle: this.getArgumentValue('pageTitle', params), + }; + } + + getServices(params: Params): NoDataPageServices { + return { ...dataCardMock.getServices(params) }; + } +} diff --git a/packages/shared-ux/page/no_data/mocks/tsconfig.json b/packages/shared-ux/page/no_data/mocks/tsconfig.json new file mode 100644 index 0000000000000..dc96ec41f9035 --- /dev/null +++ b/packages/shared-ux/page/no_data/mocks/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ] +} diff --git a/packages/shared-ux/page/no_data/types/BUILD.bazel b/packages/shared-ux/page/no_data/types/BUILD.bazel new file mode 100644 index 0000000000000..618a82a8f6a98 --- /dev/null +++ b/packages/shared-ux/page/no_data/types/BUILD.bazel @@ -0,0 +1,59 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "types" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-types" + +SRCS = glob( + [ + "*.d.ts", + ] +) + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ +] + +js_library( + name = PKG_DIRNAME, + srcs = SRCS + NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS, + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +alias( + name = "npm_module_types", + actual = ":" + PKG_DIRNAME, + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/no_data/types/README.mdx b/packages/shared-ux/page/no_data/types/README.mdx new file mode 100644 index 0000000000000..7890d0ef8a3c4 --- /dev/null +++ b/packages/shared-ux/page/no_data/types/README.mdx @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-no-data-types + +Empty package generated by @kbn/generate diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts b/packages/shared-ux/page/no_data/types/index.d.ts similarity index 66% rename from packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts rename to packages/shared-ux/page/no_data/types/index.d.ts index e22f7a7b81a77..3db9e80c950c9 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts +++ b/packages/shared-ux/page/no_data/types/index.d.ts @@ -7,31 +7,50 @@ */ import { CommonProps } from '@elastic/eui'; -import { NoDataCardProps } from '@kbn/shared-ux-card-no-data'; +import { + NoDataCardProps, + NoDataCardServices, + NoDataCardKibanaDependencies, +} from '@kbn/shared-ux-card-no-data-types'; export type NoDataPageActions = NoDataCardProps; -export interface NoDataPageProps extends CommonProps { +export interface ActionCardProps { /** - * Single name for the current solution, used to auto-generate the title, logo, description, and button label + * An object of `NoDataPageActions`. + * + * Use `elasticAgent` as the primary key for pre-configured cards of this type. + * Otherwise use a custom key that contains `EuiCard` props. */ - solution: string; + action: Record; +} + +export interface NoDataPageProps extends CommonProps, ActionCardProps { /** - * Optionally replace the auto-generated logo + * Single name for the current solution, used to auto-generate the title, logo, description, and button label */ - logo?: string; + solution: string; /** * Required to set the docs link for the whole solution */ docsLink: string; /** - * Optionally replace the auto-generated page title (h1) + * Optionally replace the auto-generated logo */ - pageTitle?: string; + logo?: string; /** - * An object of `NoDataPageActions`. - * Use `elasticAgent` as the primary key for pre-configured cards of this type. - * Otherwise use a custom key that contains `EuiCard` props. + * Optionally replace the auto-generated page title (h1) */ - action: Record; + pageTitle?: string; } + +/** + * A list of services that are consumed by this component. + */ +export type NoDataPageServices = NoDataCardServices; + +/** + * An interface containing a collection of Kibana plugins and services required to + * render this component. + */ +export type NoDataPageKibanaDependencies = NoDataCardKibanaDependencies; diff --git a/packages/shared-ux/page/no_data/types/package.json b/packages/shared-ux/page/no_data/types/package.json new file mode 100644 index 0000000000000..8e9dce1b11f45 --- /dev/null +++ b/packages/shared-ux/page/no_data/types/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/shared-ux-page-no-data-types", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/shared-ux/page/no_data/types/tsconfig.json b/packages/shared-ux/page/no_data/types/tsconfig.json new file mode 100644 index 0000000000000..7a4adfcdbecff --- /dev/null +++ b/packages/shared-ux/page/no_data/types/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "stripInternal": false, + "types": [] + }, + "include": [ + "*.d.ts" + ] +} diff --git a/packages/shared-ux/page/no_data_config/impl/BUILD.bazel b/packages/shared-ux/page/no_data_config/impl/BUILD.bazel new file mode 100644 index 0000000000000..73c069342a5a0 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/impl/BUILD.bazel @@ -0,0 +1,138 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "impl" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-config" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + "src/**/*.tsx", + "src/**/*.mdx", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ + "@npm//react", + "@npm//classnames", + "@npm//@elastic/eui", + "//packages/shared-ux/page/solution_nav", + "//packages/shared-ux/page/no_data/impl", +] + +# In this array place dependencies necessary to build the types, which will include the +# :npm_module_types target of other packages and packages from NPM, including @types/* +# packages. +# +# To reference the types for another package use: +# "//repo/relative/path/to/package:npm_module_types" +# eg. "//packages/kbn-utils:npm_module_types" +# +# References to NPM packages work the same as RUNTIME_DEPS +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/react", + "@npm//classnames", + "@npm//@elastic/eui", + "//packages/shared-ux/page/solution_nav:npm_module_types", + "//packages/shared-ux/page/no_data/impl:npm_module_types", + "//packages/shared-ux/page/no_data_config/types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/no_data_config/impl/README.mdx b/packages/shared-ux/page/no_data_config/impl/README.mdx new file mode 100644 index 0000000000000..a7f73534bbd09 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/impl/README.mdx @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-no-data-config + +Empty package generated by @kbn/generate diff --git a/packages/shared-ux/link/redirect_app/types/jest.config.js b/packages/shared-ux/page/no_data_config/impl/jest.config.js similarity index 80% rename from packages/shared-ux/link/redirect_app/types/jest.config.js rename to packages/shared-ux/page/no_data_config/impl/jest.config.js index 53269ab395d09..09a8f39000c1d 100644 --- a/packages/shared-ux/link/redirect_app/types/jest.config.js +++ b/packages/shared-ux/page/no_data_config/impl/jest.config.js @@ -7,7 +7,7 @@ */ module.exports = { - preset: '@kbn/test/jest_node', + preset: '@kbn/test', rootDir: '../../../../..', - roots: ['/packages/shared-ux/link/redirect_app/types'], + roots: ['/packages/shared-ux/page/no_data_config/impl'], }; diff --git a/packages/shared-ux/page/no_data_config/impl/package.json b/packages/shared-ux/page/no_data_config/impl/package.json new file mode 100644 index 0000000000000..216bba70b5d50 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/impl/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/shared-ux-page-no-data-config", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-shared-ux-components/src/page_template/util/constants.ts b/packages/shared-ux/page/no_data_config/impl/src/constants.ts similarity index 78% rename from packages/kbn-shared-ux-components/src/page_template/util/constants.ts rename to packages/shared-ux/page/no_data_config/impl/src/constants.ts index 92dbe1cb16279..1c4c2685433d4 100644 --- a/packages/kbn-shared-ux-components/src/page_template/util/constants.ts +++ b/packages/shared-ux/page/no_data_config/impl/src/constants.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -import { KibanaPageTemplateProps } from '../types'; +import type { NoDataConfigPageProps } from '@kbn/shared-ux-page-no-data-config-types'; export const NO_DATA_PAGE_MAX_WIDTH = 950; -export const NO_DATA_PAGE_TEMPLATE_PROPS: KibanaPageTemplateProps = { +export const NO_DATA_PAGE_TEMPLATE_PROPS: NoDataConfigPageProps = { restrictWidth: NO_DATA_PAGE_MAX_WIDTH, template: 'centeredBody', pageContentProps: { diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/index.ts b/packages/shared-ux/page/no_data_config/impl/src/index.ts similarity index 64% rename from packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/index.ts rename to packages/shared-ux/page/no_data_config/impl/src/index.ts index f8c272c8f9875..baf373726144d 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/index.ts +++ b/packages/shared-ux/page/no_data_config/impl/src/index.ts @@ -5,4 +5,11 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + export { NoDataConfigPage, NoDataConfigPageWithSolutionNavBar } from './no_data_config_page'; +export { NoDataConfigPageKibanaProvider, NoDataConfigPageProvider } from './services'; +export type { + NoDataConfigPageProps, + NoDataConfigPageServices, + NoDataConfigPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-config-types'; diff --git a/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.stories.tsx b/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.stories.tsx new file mode 100644 index 0000000000000..3106a5b41416d --- /dev/null +++ b/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.stories.tsx @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; + +import { NoDataConfigPageStorybookMock } from '@kbn/shared-ux-page-no-data-config-mocks'; +import type { NoDataConfigPageStorybookParams } from '@kbn/shared-ux-page-no-data-config-mocks'; + +import { NoDataConfigPage as Component } from './no_data_config_page'; + +import { NoDataConfigPageProvider } from './services'; +import mdx from '../README.mdx'; + +const mock = new NoDataConfigPageStorybookMock(); + +export default { + title: 'No Data/Page/No Data Config Page', + description: 'A component to display when there is no data available', + parameters: { + docs: { + page: mdx, + }, + }, +}; + +export const NoDataConfigPage = (params: NoDataConfigPageStorybookParams) => { + return ( + + + + ); +}; + +NoDataConfigPage.argTypes = mock.getArgumentTypes(); diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.test.tsx b/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.test.tsx similarity index 55% rename from packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.test.tsx rename to packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.test.tsx index dc618a068e120..fbd897314eceb 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.test.tsx +++ b/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.test.tsx @@ -6,13 +6,17 @@ * Side Public License, v 1. */ -import { shallow } from 'enzyme'; import React from 'react'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; + +import { getNoDataConfigPageServicesMock } from '@kbn/shared-ux-page-no-data-config-mocks'; + import { NoDataConfigPage } from './no_data_config_page'; +import { NoDataConfigPageProvider } from './services'; describe('NoDataConfigPage', () => { const noDataConfig = { - solution: 'Kibana', + solution: 'Solution', logo: 'logoKibana', docsLink: 'test-link', action: { @@ -24,7 +28,12 @@ describe('NoDataConfigPage', () => { }, }; test('renders', () => { - const component = shallow(); - expect(component).toMatchSnapshot(); + const component = mountWithIntl( + + + + ); + expect(component.find('h1').html()).toContain('Welcome to Elastic Solution!'); + expect(component.find('button').html()).toContain('Click me'); }); }); diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx b/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx similarity index 54% rename from packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx rename to packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx index c21431a8107fe..f5153aa25686e 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx +++ b/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx @@ -7,29 +7,36 @@ */ import React from 'react'; +import classNames from 'classnames'; import { EuiPageTemplate } from '@elastic/eui'; + import { withSolutionNav } from '@kbn/shared-ux-page-solution-nav'; +import { NoDataPage } from '@kbn/shared-ux-page-no-data'; +import type { NoDataConfigPageProps } from '@kbn/shared-ux-page-no-data-config-types'; + +import { NO_DATA_PAGE_TEMPLATE_PROPS } from './constants'; -import { NoDataPage } from '../no_data_page'; -import { KibanaPageTemplateProps } from '../../types'; -import { getClasses, NO_DATA_PAGE_TEMPLATE_PROPS } from '../../util'; +const getClasses = (template?: string, className?: string) => { + return classNames( + 'kbnPageTemplate', + template ? { [`kbnPageTemplate--${template}`]: template } : '', + className || '' + ); +}; -export const NoDataConfigPage = (props: KibanaPageTemplateProps) => { - const { className, noDataConfig, ...rest } = props; +export const NoDataConfigPage = (props: NoDataConfigPageProps) => { + const { className: classNameProp, noDataConfig, ...rest } = props; if (!noDataConfig) { return null; } - const template = NO_DATA_PAGE_TEMPLATE_PROPS.template; - const classes = getClasses(template, className); + const className = getClasses(NO_DATA_PAGE_TEMPLATE_PROPS.template, classNameProp); return ( diff --git a/packages/shared-ux/page/no_data_config/impl/src/services.tsx b/packages/shared-ux/page/no_data_config/impl/src/services.tsx new file mode 100644 index 0000000000000..a7d0d118c053d --- /dev/null +++ b/packages/shared-ux/page/no_data_config/impl/src/services.tsx @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { FC } from 'react'; + +import { NoDataPageProvider, NoDataPageKibanaProvider } from '@kbn/shared-ux-page-no-data'; +import type { + NoDataConfigPageServices, + NoDataConfigPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-config-types'; + +/** + * A Context Provider that provides services to the component and its dependencies. + */ +export const NoDataConfigPageProvider: FC = ({ + children, + ...services +}) => { + return {children}; +}; + +/** + * Kibana-specific Provider that maps dependencies to services. + */ +export const NoDataConfigPageKibanaProvider: FC = ({ + children, + ...dependencies +}) => { + return {children}; +}; diff --git a/packages/shared-ux/page/no_data_config/impl/tsconfig.json b/packages/shared-ux/page/no_data_config/impl/tsconfig.json new file mode 100644 index 0000000000000..40ed24ecac4d2 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/impl/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node", + "react", + "@kbn/ambient-ui-types", + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel b/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel new file mode 100644 index 0000000000000..0a797fd6de629 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel @@ -0,0 +1,140 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "mocks" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-config-mocks" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ + "@npm//react", + "//packages/shared-ux/page/no_data/mocks", +] + +# In this array place dependencies necessary to build the types, which will include the +# :npm_module_types target of other packages and packages from NPM, including @types/* +# packages. +# +# To reference the types for another package use: +# "//repo/relative/path/to/package:npm_module_types" +# eg. "//packages/kbn-utils:npm_module_types" +# +# References to NPM packages work the same as RUNTIME_DEPS +TYPES_DEPS = [ + "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", + "//packages/shared-ux/page/no_data_config/types", + "//packages/shared-ux/page/no_data/mocks:npm_module_types", + "//packages/shared-ux/storybook/mock:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/no_data_config/mocks/README.md b/packages/shared-ux/page/no_data_config/mocks/README.md new file mode 100644 index 0000000000000..bcf739e2d9658 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/mocks/README.md @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-no-data-config-mocks + +Empty package generated by @kbn/generate diff --git a/packages/shared-ux/page/no_data_config/mocks/package.json b/packages/shared-ux/page/no_data_config/mocks/package.json new file mode 100644 index 0000000000000..32245715f2b1b --- /dev/null +++ b/packages/shared-ux/page/no_data_config/mocks/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/shared-ux-page-no-data-config-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/src/plugins/chart_expressions/expression_gauge/public/components/icons/index.ts b/packages/shared-ux/page/no_data_config/mocks/src/index.ts similarity index 62% rename from src/plugins/chart_expressions/expression_gauge/public/components/icons/index.ts rename to packages/shared-ux/page/no_data_config/mocks/src/index.ts index 79ef0dcad9d7a..4e6911f89e37b 100644 --- a/src/plugins/chart_expressions/expression_gauge/public/components/icons/index.ts +++ b/packages/shared-ux/page/no_data_config/mocks/src/index.ts @@ -6,5 +6,7 @@ * Side Public License, v 1. */ -export { HorizontalBulletIcon } from './horizontal_bullet_icon'; -export { VerticalBulletIcon } from './vertical_bullet_icon'; +export { getServicesMock as getNoDataConfigPageServicesMock } from './jest'; + +export { NoDataConfigPageStorybookMock } from './storybook'; +export type { Params as NoDataConfigPageStorybookParams } from './storybook'; diff --git a/packages/shared-ux/page/no_data_config/mocks/src/jest.ts b/packages/shared-ux/page/no_data_config/mocks/src/jest.ts new file mode 100644 index 0000000000000..f4f2c48e4ce03 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/mocks/src/jest.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 { + NoDataConfigPageServices, + NoDataConfigPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-config-types'; + +import { + getNoDataPageServicesMock, + getNoDataPageKibanaDependenciesMock, +} from '@kbn/shared-ux-page-no-data-mocks'; + +export const getServicesMock = () => { + const services: NoDataConfigPageServices = { + ...getNoDataPageServicesMock(), + }; + + return services; +}; + +export const getKibanaDependenciesMock = () => { + const dependencies: NoDataConfigPageKibanaDependencies = { + ...getNoDataPageKibanaDependenciesMock(), + }; + + return dependencies; +}; diff --git a/packages/shared-ux/page/no_data_config/mocks/src/storybook.ts b/packages/shared-ux/page/no_data_config/mocks/src/storybook.ts new file mode 100644 index 0000000000000..5c36fc79f90a7 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/mocks/src/storybook.ts @@ -0,0 +1,74 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AbstractStorybookMock } from '@kbn/shared-ux-storybook-mock'; +import type { ArgumentParams } from '@kbn/shared-ux-storybook-mock'; + +import type { + NoDataConfig, + NoDataConfigPageProps, + NoDataConfigPageServices, +} from '@kbn/shared-ux-page-no-data-config-types'; +import { NoDataPageStorybookMock } from '@kbn/shared-ux-page-no-data-mocks'; +import type { NoDataPageStorybookParams } from '@kbn/shared-ux-page-no-data-mocks'; + +type PropArguments = Pick; + +export type Params = ArgumentParams & NoDataPageStorybookParams; + +const dataPageMock = new NoDataPageStorybookMock(); + +export class NoDataConfigPageStorybookMock extends AbstractStorybookMock< + NoDataConfigPageProps, + NoDataConfigPageServices, + PropArguments +> { + propArguments = { + solution: { + control: 'text', + defaultValue: 'Observability', + }, + logo: { + control: { type: 'radio' }, + options: ['logoElastic', 'logoKibana', 'logoCloud', undefined], + defaultValue: undefined, + }, + docsLink: { + control: 'text', + defaultValue: 'docs/link', + }, + pageTitle: { + control: 'text', + defaultValue: '', + }, + }; + + serviceArguments = {}; + + dependencies = [dataPageMock]; + + getProps(params?: Params): NoDataConfigPageProps { + return { + noDataConfig: { + action: { + elasticAgent: { + title: 'Add Integrations', + }, + }, + solution: this.getArgumentValue('solution', params), + logo: this.getArgumentValue('logo', params), + docsLink: this.getArgumentValue('docsLink', params), + pageTitle: this.getArgumentValue('pageTitle', params), + }, + }; + } + + getServices(params: Params): NoDataConfigPageServices { + return { ...dataPageMock.getServices(params) }; + } +} diff --git a/packages/shared-ux/page/no_data_config/mocks/tsconfig.json b/packages/shared-ux/page/no_data_config/mocks/tsconfig.json new file mode 100644 index 0000000000000..dc96ec41f9035 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/mocks/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ] +} diff --git a/packages/shared-ux/page/no_data_config/types/BUILD.bazel b/packages/shared-ux/page/no_data_config/types/BUILD.bazel new file mode 100644 index 0000000000000..6fa1669fcc176 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/types/BUILD.bazel @@ -0,0 +1,59 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "types" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-config-types" + +SRCS = glob( + [ + "*.d.ts", + ] +) + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ +] + +js_library( + name = PKG_DIRNAME, + srcs = SRCS + NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS, + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +alias( + name = "npm_module_types", + actual = ":" + PKG_DIRNAME, + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/no_data_config/types/README.md b/packages/shared-ux/page/no_data_config/types/README.md new file mode 100644 index 0000000000000..dd146f60dcf4b --- /dev/null +++ b/packages/shared-ux/page/no_data_config/types/README.md @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-no-data-config-types + +Empty package generated by @kbn/generate diff --git a/packages/shared-ux/page/no_data_config/types/index.d.ts b/packages/shared-ux/page/no_data_config/types/index.d.ts new file mode 100644 index 0000000000000..10950bcf296c8 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/types/index.d.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 { EuiPageTemplateProps } from '@elastic/eui'; + +import type { + NoDataPageProps, + NoDataPageServices, + NoDataPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-types'; + +export type NoDataConfigPageKibanaDependencies = NoDataPageKibanaDependencies; +export type NoDataConfigPageServices = NoDataPageServices; +export type NoDataConfig = NoDataPageProps; + +export type NoDataConfigPageProps = EuiPageTemplateProps & { + /** + * Accepts a configuration object, that when provided, ignores pageHeader and children and instead + * displays Agent, Beats, and custom cards to direct users to the right ingest location + */ + noDataConfig?: NoDataConfig; +}; diff --git a/packages/shared-ux/page/no_data_config/types/package.json b/packages/shared-ux/page/no_data_config/types/package.json new file mode 100644 index 0000000000000..1af47fb4c5028 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/types/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/shared-ux-page-no-data-config-types", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/shared-ux/page/no_data_config/types/tsconfig.json b/packages/shared-ux/page/no_data_config/types/tsconfig.json new file mode 100644 index 0000000000000..7a4adfcdbecff --- /dev/null +++ b/packages/shared-ux/page/no_data_config/types/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "stripInternal": false, + "types": [] + }, + "include": [ + "*.d.ts" + ] +} diff --git a/packages/shared-ux/page/solution_nav/src/solution_nav.stories.tsx b/packages/shared-ux/page/solution_nav/src/solution_nav.stories.tsx index 9613fbac42f6e..2f22aad173771 100644 --- a/packages/shared-ux/page/solution_nav/src/solution_nav.stories.tsx +++ b/packages/shared-ux/page/solution_nav/src/solution_nav.stories.tsx @@ -11,7 +11,7 @@ import { action } from '@storybook/addon-actions'; import { SolutionNav as Component, SolutionNavProps } from './solution_nav'; export default { - title: 'Page Template', + title: 'Page/Solution Nav', description: 'Solution-specific navigation for the sidebar', }; diff --git a/packages/shared-ux/prompt/no_data_views/impl/src/index.ts b/packages/shared-ux/prompt/no_data_views/impl/src/index.ts index 9483e5406da4c..48afcb7936997 100644 --- a/packages/shared-ux/prompt/no_data_views/impl/src/index.ts +++ b/packages/shared-ux/prompt/no_data_views/impl/src/index.ts @@ -8,7 +8,7 @@ export type { NoDataViewsPromptComponentProps, - NoDataViewsPromptKibanaServices, + NoDataViewsPromptKibanaDependencies, NoDataViewsPromptProps, NoDataViewsPromptServices, } from '@kbn/shared-ux-prompt-no-data-views-types'; diff --git a/packages/shared-ux/prompt/no_data_views/impl/src/no_data_views.stories.tsx b/packages/shared-ux/prompt/no_data_views/impl/src/no_data_views.stories.tsx index 56d4ec63d2eaa..748687fbda5e8 100644 --- a/packages/shared-ux/prompt/no_data_views/impl/src/no_data_views.stories.tsx +++ b/packages/shared-ux/prompt/no_data_views/impl/src/no_data_views.stories.tsx @@ -29,7 +29,7 @@ export default { const mock = new NoDataViewsPromptStorybookMock(); -export const NoDataViews = (params: NoDataViewsPromptStorybookParams) => { +export const Prompt = (params: NoDataViewsPromptStorybookParams) => { return ( @@ -37,4 +37,4 @@ export const NoDataViews = (params: NoDataViewsPromptStorybookParams) => { ); }; -NoDataViews.argTypes = mock.getArgumentTypes(); +Prompt.argTypes = mock.getArgumentTypes(); diff --git a/packages/shared-ux/prompt/no_data_views/impl/src/services.tsx b/packages/shared-ux/prompt/no_data_views/impl/src/services.tsx index cf6236429441f..b8fe90e1ef135 100644 --- a/packages/shared-ux/prompt/no_data_views/impl/src/services.tsx +++ b/packages/shared-ux/prompt/no_data_views/impl/src/services.tsx @@ -9,7 +9,7 @@ import React, { FC, useContext } from 'react'; import type { NoDataViewsPromptServices, - NoDataViewsPromptKibanaServices, + NoDataViewsPromptKibanaDependencies, } from '@kbn/shared-ux-prompt-no-data-views-types'; const NoDataViewsPromptContext = React.createContext(null); @@ -37,7 +37,7 @@ export const NoDataViewsPromptProvider: FC = ({ /** * Kibana-specific Provider that maps to known dependency types. */ -export const NoDataViewsPromptKibanaProvider: FC = ({ +export const NoDataViewsPromptKibanaProvider: FC = ({ children, ...services }) => { diff --git a/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel b/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel index 21099840dc91e..6f725e99b6147 100644 --- a/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel +++ b/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel @@ -10,8 +10,17 @@ SOURCE_FILES = glob( "src/**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -38,6 +47,7 @@ NPM_MODULE_EXTRA_FILES = [ # eg. "@npm//lodash" RUNTIME_DEPS = [ "@npm//@storybook/addon-actions", + "@npm//react", "//packages/shared-ux/storybook/mock", ] @@ -51,9 +61,10 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", "@npm//@storybook/addon-actions", + "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", "//packages/shared-ux/prompt/no_data_views/types:npm_module_types", "//packages/shared-ux/storybook/mock:npm_module_types", ] @@ -65,6 +76,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -90,7 +109,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/prompt/no_data_views/mocks/jest.config.js b/packages/shared-ux/prompt/no_data_views/mocks/jest.config.js deleted file mode 100644 index 1efd78b09a8b1..0000000000000 --- a/packages/shared-ux/prompt/no_data_views/mocks/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/jest_node', - rootDir: '../../../../..', - roots: ['/packages/shared-ux/prompt/no_data_views/mocks'], -}; diff --git a/packages/shared-ux/prompt/no_data_views/mocks/package.json b/packages/shared-ux/prompt/no_data_views/mocks/package.json index b00c829ace8e5..2478bd3e76dd4 100644 --- a/packages/shared-ux/prompt/no_data_views/mocks/package.json +++ b/packages/shared-ux/prompt/no_data_views/mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json b/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json index 894f01d3220e9..dc96ec41f9035 100644 --- a/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json +++ b/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json @@ -9,10 +9,12 @@ "stripInternal": false, "types": [ "jest", - "node" + "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/packages/shared-ux/prompt/no_data_views/types/index.d.ts b/packages/shared-ux/prompt/no_data_views/types/index.d.ts index e143e4e6d035c..4b428cc64ad3d 100644 --- a/packages/shared-ux/prompt/no_data_views/types/index.d.ts +++ b/packages/shared-ux/prompt/no_data_views/types/index.d.ts @@ -42,7 +42,7 @@ export interface NoDataViewsPromptServices { /** * Kibana-specific service types. */ -export interface NoDataViewsPromptKibanaServices { +export interface NoDataViewsPromptKibanaDependencies { coreStart: { docLinks: { links: { diff --git a/packages/kbn-shared-ux-storybook/BUILD.bazel b/packages/shared-ux/storybook/config/BUILD.bazel similarity index 88% rename from packages/kbn-shared-ux-storybook/BUILD.bazel rename to packages/shared-ux/storybook/config/BUILD.bazel index 4f710f2dbe120..1f35734bb2147 100644 --- a/packages/kbn-shared-ux-storybook/BUILD.bazel +++ b/packages/shared-ux/storybook/config/BUILD.bazel @@ -2,16 +2,25 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_DIRNAME = "kbn-shared-ux-storybook" -PKG_REQUIRE_NAME = "@kbn/shared-ux-storybook" +PKG_DIRNAME = "config" +PKG_REQUIRE_NAME = "@kbn/shared-ux-storybook-config" SOURCE_FILES = glob( [ - "src/**/*.ts", - "src/**/*.tsx", + "**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -37,10 +46,10 @@ NPM_MODULE_EXTRA_FILES = [ # "@npm//name-of-package" # eg. "@npm//lodash" RUNTIME_DEPS = [ - "//packages/kbn-shared-ux-services", "//packages/kbn-storybook", "@npm//@storybook/react", "@npm//@storybook/addon-actions", + "@npm//jest-mock", ] # In this array place dependencies necessary to build the types, which will include the @@ -53,7 +62,7 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "//packages/kbn-shared-ux-services:npm_module_types", + "@npm//jest-mock", "//packages/kbn-storybook:npm_module_types", "//packages/kbn-ambient-ui-types:npm_module_types", "//packages/kbn-ambient-storybook-types:npm_module_types", @@ -67,14 +76,12 @@ jsts_transpiler( name = "target_node", srcs = SRCS, build_pkg_name = package_name(), - root_input_dir = "src", ) jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - root_input_dir = "src", web = True, ) @@ -96,7 +103,7 @@ ts_project( declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - root_dir = "src", + root_dir = ".", tsconfig = ":tsconfig", ) diff --git a/packages/shared-ux/storybook/config/README.mdx b/packages/shared-ux/storybook/config/README.mdx new file mode 100644 index 0000000000000..eeab8f1f4c987 --- /dev/null +++ b/packages/shared-ux/storybook/config/README.mdx @@ -0,0 +1,3 @@ +# @kbn/shared-ux-storybook-config + +Storybook configuration used by `yarn storybook`. Refer to `@kbn/storybook` for more information. diff --git a/packages/kbn-shared-ux-components/src/page_template/util/presentation.ts b/packages/shared-ux/storybook/config/constants.ts similarity index 58% rename from packages/kbn-shared-ux-components/src/page_template/util/presentation.ts rename to packages/shared-ux/storybook/config/constants.ts index ab7144ee37b57..8efe045ad57a1 100644 --- a/packages/kbn-shared-ux-components/src/page_template/util/presentation.ts +++ b/packages/shared-ux/storybook/config/constants.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import classNames from 'classnames'; +/** The title of the Storybook. */ +export const TITLE = 'Shared UX Storybook'; -export const getClasses = (template: string | undefined, className: string | undefined) => { - return classNames('kbnPageTemplate', { [`kbnPageTemplate--${template}`]: template }, className); -}; +/** The remote URL of the root from which Storybook loads stories for Shared UX. */ +export const URL = 'https://github.com/elastic/kibana/tree/main/packages/shared_ux'; diff --git a/packages/kbn-shared-ux-components/src/page_template/util/index.ts b/packages/shared-ux/storybook/config/index.ts similarity index 82% rename from packages/kbn-shared-ux-components/src/page_template/util/index.ts rename to packages/shared-ux/storybook/config/index.ts index adfefdf834566..5a73da614bf27 100644 --- a/packages/kbn-shared-ux-components/src/page_template/util/index.ts +++ b/packages/shared-ux/storybook/config/index.ts @@ -6,5 +6,4 @@ * Side Public License, v 1. */ -export { getClasses } from './presentation'; -export * from './constants'; +export { TITLE, URL } from './constants'; diff --git a/packages/kbn-shared-ux-storybook/src/config/main.ts b/packages/shared-ux/storybook/config/main.ts similarity index 72% rename from packages/kbn-shared-ux-storybook/src/config/main.ts rename to packages/shared-ux/storybook/config/main.ts index 6e57ca8ad5e72..47a47a5a802b3 100644 --- a/packages/kbn-shared-ux-storybook/src/config/main.ts +++ b/packages/shared-ux/storybook/config/main.ts @@ -10,11 +10,7 @@ import { defaultConfig } from '@kbn/storybook'; module.exports = { ...defaultConfig, - stories: [ - '../../../shared-ux/**/*.stories.+(tsx|mdx)', - '../../../kbn-shared-ux*/**/*.stories.+(tsx|mdx)', - '../../../../src/plugins/shared_ux/**/*.stories.+(tsx|mdx)', - ], + stories: ['../../**/*.stories.+(tsx|mdx)'], reactOptions: { strictMode: true, }, diff --git a/packages/kbn-shared-ux-storybook/src/config/manager.ts b/packages/shared-ux/storybook/config/manager.ts similarity index 72% rename from packages/kbn-shared-ux-storybook/src/config/manager.ts rename to packages/shared-ux/storybook/config/manager.ts index 64284fb46f36f..fb973258b9053 100644 --- a/packages/kbn-shared-ux-storybook/src/config/manager.ts +++ b/packages/shared-ux/storybook/config/manager.ts @@ -8,14 +8,16 @@ import { addons } from '@storybook/addons'; import { create } from '@storybook/theming'; -import { PANEL_ID } from '@storybook/addon-actions'; +import { PANEL_ID as selectedPanel } from '@storybook/addon-actions'; + +import { TITLE as brandTitle, URL as brandUrl } from './constants'; addons.setConfig({ theme: create({ base: 'light', - brandTitle: 'Shared UX Storybook', - brandUrl: 'https://github.com/elastic/kibana/tree/main/src/plugins/shared_ux', + brandTitle, + brandUrl, }), + selectedPanel, showPanel: true.valueOf, - selectedPanel: PANEL_ID, }); diff --git a/packages/kbn-shared-ux-storybook/package.json b/packages/shared-ux/storybook/config/package.json similarity index 78% rename from packages/kbn-shared-ux-storybook/package.json rename to packages/shared-ux/storybook/config/package.json index c5f22bb151431..ee7206b2d87df 100644 --- a/packages/kbn-shared-ux-storybook/package.json +++ b/packages/shared-ux/storybook/config/package.json @@ -1,8 +1,8 @@ { - "name": "@kbn/shared-ux-storybook", + "name": "@kbn/shared-ux-storybook-config", "private": true, "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/shared-ux/storybook/config/preview.ts b/packages/shared-ux/storybook/config/preview.ts new file mode 100644 index 0000000000000..5a53e48a916d8 --- /dev/null +++ b/packages/shared-ux/storybook/config/preview.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. + */ + +/* eslint-disable @typescript-eslint/no-namespace,@typescript-eslint/no-empty-interface */ +declare global { + namespace NodeJS { + interface Global {} + interface InspectOptions {} + type ConsoleConstructor = console.ConsoleConstructor; + } +} +/* eslint-enable */ + +import jest from 'jest-mock'; +/* @ts-expect-error TS doesn't see jest as a property of window, and I don't want to edit our global config. */ +window.jest = jest; diff --git a/packages/kbn-shared-ux-storybook/tsconfig.json b/packages/shared-ux/storybook/config/tsconfig.json similarity index 78% rename from packages/kbn-shared-ux-storybook/tsconfig.json rename to packages/shared-ux/storybook/config/tsconfig.json index b26c95a01dfd8..835b78a44758d 100644 --- a/packages/kbn-shared-ux-storybook/tsconfig.json +++ b/packages/shared-ux/storybook/config/tsconfig.json @@ -1,11 +1,11 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": "src", + "rootDir": ".", "stripInternal": false, "types": [ "jest", @@ -14,6 +14,6 @@ ] }, "include": [ - "src/**/*" + "*.ts" ] } diff --git a/packages/shared-ux/storybook/mock/BUILD.bazel b/packages/shared-ux/storybook/mock/BUILD.bazel index 71b1a263ea0af..c77d05261bc1d 100644 --- a/packages/shared-ux/storybook/mock/BUILD.bazel +++ b/packages/shared-ux/storybook/mock/BUILD.bazel @@ -10,8 +10,17 @@ SOURCE_FILES = glob( "src/**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -37,6 +46,8 @@ NPM_MODULE_EXTRA_FILES = [ # "@npm//name-of-package" # eg. "@npm//lodash" RUNTIME_DEPS = [ + "@npm//@storybook/react", + "@npm//react", ] # In this array place dependencies necessary to build the types, which will include the @@ -49,9 +60,10 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", "@npm//@storybook/react", + "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", ] jsts_transpiler( @@ -61,6 +73,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -86,7 +106,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/storybook/mock/package.json b/packages/shared-ux/storybook/mock/package.json index 18761aab4c92c..0baee9437cac0 100644 --- a/packages/shared-ux/storybook/mock/package.json +++ b/packages/shared-ux/storybook/mock/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/storybook/mock/tsconfig.json b/packages/shared-ux/storybook/mock/tsconfig.json index 39d3c7097814a..7b7386979c9a8 100644 --- a/packages/shared-ux/storybook/mock/tsconfig.json +++ b/packages/shared-ux/storybook/mock/tsconfig.json @@ -9,10 +9,12 @@ "stripInternal": false, "types": [ "jest", - "node" + "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/renovate.json b/renovate.json index 49337a00d7246..5668714d4271c 100644 --- a/renovate.json +++ b/renovate.json @@ -168,7 +168,7 @@ }, { "groupName": "react-query", - "packageNames": ["react-query"], + "packageNames": ["@tanstack/react-query", "@tanstack/react-query-devtools"], "reviewers": [ "team:response-ops", "team:kibana-cloud-security-posture", diff --git a/scripts/synthtrace.js b/scripts/synthtrace.js index 5e551acf84769..bffa55065a17f 100644 --- a/scripts/synthtrace.js +++ b/scripts/synthtrace.js @@ -9,8 +9,8 @@ require('../src/setup_node_env'); // We have to import directly from package since scenarios and worker.js are imported dynamically, -// If we import the package (require('@elastic/apm-synthtrace')) the program will be executed on the compiled files, and thus we need to +// If we import the package (require('@kbn/apm-synthtrace')) the program will be executed on the compiled files, and thus we need to // compile scenarios with `yarn kbn bootstrap` every time scenario changes. // eslint-disable-next-line @kbn/imports/uniform_imports -require('../packages/elastic-apm-synthtrace/src/cli').runSynthtrace(); +require('../packages/kbn-apm-synthtrace/src/cli').runSynthtrace(); diff --git a/src/cli/command.js b/src/cli/command.js index 6174cab85dec3..b85037330027b 100644 --- a/src/cli/command.js +++ b/src/cli/command.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import Chalk from 'chalk'; diff --git a/src/cli/keystore/read_keystore.js b/src/cli/keystore/read_keystore.js index d3629c32671f7..a4f007690a661 100644 --- a/src/cli/keystore/read_keystore.js +++ b/src/cli/keystore/read_keystore.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { Keystore } from '.'; import { getKeystore } from '../../cli_keystore/get_keystore'; diff --git a/src/cli/serve/serve.js b/src/cli/serve/serve.js index 6425b0d6c8005..d5c1f844c4d1c 100644 --- a/src/cli/serve/serve.js +++ b/src/cli/serve/serve.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set as lodashSet } from '@elastic/safer-lodash-set'; +import { set as lodashSet } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import { statSync } from 'fs'; import { resolve } from 'path'; diff --git a/src/core/public/chrome/ui/header/collapsible_nav.tsx b/src/core/public/chrome/ui/header/collapsible_nav.tsx index abf4c5f0965eb..01064662ad304 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav.tsx @@ -93,6 +93,7 @@ const overviewIDs = [ 'observability-overview', 'securitySolutionUI:get_started', 'management', + 'enterpriseSearch', ]; export function CollapsibleNav({ diff --git a/src/core/server/core_app/bundle_routes/select_compressed_file.ts b/src/core/server/core_app/bundle_routes/select_compressed_file.ts index 36c63f653618c..339a99b635aaf 100644 --- a/src/core/server/core_app/bundle_routes/select_compressed_file.ts +++ b/src/core/server/core_app/bundle_routes/select_compressed_file.ts @@ -40,10 +40,6 @@ export async function selectCompressedFile(acceptEncodingHeader: string | undefi fileEncoding = 'br'; fd = await tryToOpenFile(`${path}.br`); } - if (!fd && supportedEncodings.includes('gzip')) { - fileEncoding = 'gzip'; - fd = await tryToOpenFile(`${path}.gz`); - } } if (!fd) { diff --git a/src/core/server/integration_tests/saved_objects/migrations/actions/actions.test.ts b/src/core/server/integration_tests/saved_objects/migrations/actions/actions.test.ts index c616138c31af5..a656b0bdd10e5 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/actions/actions.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/actions/actions.test.ts @@ -475,7 +475,7 @@ describe('migration actions', () => { source: 'existing_index_with_write_block', target: 'clone_target_1', }); - expect.assertions(1); + expect.assertions(3); await expect(task()).resolves.toMatchInlineSnapshot(` Object { "_tag": "Right", @@ -485,6 +485,12 @@ describe('migration actions', () => { }, } `); + const { clone_target_1: cloneTarget1 } = await client.indices.getSettings({ + index: 'clone_target_1', + }); + // @ts-expect-error https://github.com/elastic/elasticsearch/issues/89381 + expect(cloneTarget1.settings?.index.mapping?.total_fields.limit).toBe('1500'); + expect(cloneTarget1.settings?.blocks?.write).toBeUndefined(); }); it('resolves right if clone target already existed after waiting for index status to be green ', async () => { expect.assertions(2); @@ -1612,6 +1618,11 @@ describe('migration actions', () => { _tag: 'Right', right: 'create_index_succeeded', }); + const { create_new_index: createNewIndex } = await client.indices.getSettings({ + index: 'create_new_index', + }); + // @ts-expect-error https://github.com/elastic/elasticsearch/issues/89381 + expect(createNewIndex.settings?.index?.mapping.total_fields.limit).toBe('1500'); }); it('resolves left if an existing index status does not become green', async () => { expect.assertions(2); diff --git a/src/core/server/saved_objects/migrations/actions/clone_index.ts b/src/core/server/saved_objects/migrations/actions/clone_index.ts index 80b2ff527740c..e95f969f4ad82 100644 --- a/src/core/server/saved_objects/migrations/actions/clone_index.ts +++ b/src/core/server/saved_objects/migrations/actions/clone_index.ts @@ -64,20 +64,25 @@ export const cloneIndex = ({ index: source, target, wait_for_active_shards: WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE, - body: { - settings: { - index: { - // The source we're cloning from will have a write block set, so - // we need to remove it to allow writes to our newly cloned index - 'blocks.write': false, - number_of_shards: INDEX_NUMBER_OF_SHARDS, - auto_expand_replicas: INDEX_AUTO_EXPAND_REPLICAS, - // Set an explicit refresh interval so that we don't inherit the - // value from incorrectly configured index templates (not required - // after we adopt system indices) - refresh_interval: '1s', - // Bump priority so that recovery happens before newer indices - priority: 10, + settings: { + index: { + // The source we're cloning from will have a write block set, so + // we need to remove it to allow writes to our newly cloned index + 'blocks.write': false, + // The rest of the index settings should have already been applied + // to the source index and will be copied to the clone target. But + // we repeat it here for explicitness. + number_of_shards: INDEX_NUMBER_OF_SHARDS, + auto_expand_replicas: INDEX_AUTO_EXPAND_REPLICAS, + // Set an explicit refresh interval so that we don't inherit the + // value from incorrectly configured index templates (not required + // after we adopt system indices) + refresh_interval: '1s', + // Bump priority so that recovery happens before newer indices + priority: 10, + // Increase the fields limit beyond the default of 1000 + mapping: { + total_fields: { limit: 1500 }, }, }, }, diff --git a/src/core/server/saved_objects/migrations/actions/create_index.ts b/src/core/server/saved_objects/migrations/actions/create_index.ts index 41ee20fc9562d..0f6b062a42163 100644 --- a/src/core/server/saved_objects/migrations/actions/create_index.ts +++ b/src/core/server/saved_objects/migrations/actions/create_index.ts @@ -82,21 +82,24 @@ export const createIndex = ({ // available. If the request doesn't complete within timeout, // acknowledged or shards_acknowledged would be false. timeout, - body: { - mappings, - aliases: aliasesObject, - settings: { - index: { - // ES rule of thumb: shards should be several GB to 10's of GB, so - // Kibana is unlikely to cross that limit. - number_of_shards: 1, - auto_expand_replicas: INDEX_AUTO_EXPAND_REPLICAS, - // Set an explicit refresh interval so that we don't inherit the - // value from incorrectly configured index templates (not required - // after we adopt system indices) - refresh_interval: '1s', - // Bump priority so that recovery happens before newer indices - priority: 10, + mappings, + aliases: aliasesObject, + settings: { + index: { + // ES rule of thumb: shards should be several GB to 10's of GB, so + // Kibana is unlikely to cross that limit. + number_of_shards: 1, + auto_expand_replicas: INDEX_AUTO_EXPAND_REPLICAS, + // Set an explicit refresh interval so that we don't inherit the + // value from incorrectly configured index templates (not required + // after we adopt system indices) + refresh_interval: '1s', + // Bump priority so that recovery happens before newer indices + priority: 10, + // Increase the fields limit beyond the default of 1000 + // @ts-expect-error https://github.com/elastic/elasticsearch/issues/89381 + mapping: { + total_fields: { limit: 1500 }, }, }, }, diff --git a/src/core/server/saved_objects/migrations/core/document_migrator.test.ts b/src/core/server/saved_objects/migrations/core/document_migrator.test.ts index d126cdce88253..1d12d2062be93 100644 --- a/src/core/server/saved_objects/migrations/core/document_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/core/document_migrator.test.ts @@ -7,7 +7,7 @@ */ import { mockGetConvertedObjectId } from './document_migrator.test.mock'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import type { SavedObjectUnsanitizedDoc, SavedObjectsType } from '@kbn/core-saved-objects-server'; import { DocumentMigrator } from './document_migrator'; diff --git a/src/core/server/saved_objects/migrations/core/document_migrator.ts b/src/core/server/saved_objects/migrations/core/document_migrator.ts index 3782a74936b6e..677b2a685f64e 100644 --- a/src/core/server/saved_objects/migrations/core/document_migrator.ts +++ b/src/core/server/saved_objects/migrations/core/document_migrator.ts @@ -43,7 +43,7 @@ import Boom from '@hapi/boom'; import uuidv5 from 'uuid/v5'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import Semver from 'semver'; import type { Logger } from '@kbn/logging'; diff --git a/src/core/server/saved_objects/migrations/core/migrate_raw_docs.test.ts b/src/core/server/saved_objects/migrations/core/migrate_raw_docs.test.ts index 03124f6e7fde7..09ec13bcae05b 100644 --- a/src/core/server/saved_objects/migrations/core/migrate_raw_docs.test.ts +++ b/src/core/server/saved_objects/migrations/core/migrate_raw_docs.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import * as Either from 'fp-ts/lib/Either'; import _ from 'lodash'; import { SavedObjectTypeRegistry } from '../../saved_objects_type_registry'; diff --git a/src/core/server/saved_objects/service/lib/filter_utils.ts b/src/core/server/saved_objects/service/lib/filter_utils.ts index 27ff1c201cbdd..30880368d096d 100644 --- a/src/core/server/saved_objects/service/lib/filter_utils.ts +++ b/src/core/server/saved_objects/service/lib/filter_utils.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get, cloneDeep } from 'lodash'; import * as esKuery from '@kbn/es-query'; import { SavedObjectsErrorHelpers } from './errors'; diff --git a/src/core/server/ui_settings/saved_objects/migrations.test.ts b/src/core/server/ui_settings/saved_objects/migrations.test.ts index df561ef4152f6..c08f75ad9d184 100644 --- a/src/core/server/ui_settings/saved_objects/migrations.test.ts +++ b/src/core/server/ui_settings/saved_objects/migrations.test.ts @@ -310,3 +310,38 @@ describe('ui_settings 8.1.0 migrations', () => { }); }); }); + +describe('ui_settings 8.5.0 migrations', () => { + const migration = migrations['8.5.0']; + + test('returns doc on empty object', () => { + expect(migration({} as SavedObjectUnsanitizedDoc)).toEqual({ + references: [], + }); + }); + + test('removes "observability:enableInfrastructureView" setting', () => { + const doc = { + type: 'config', + id: '8.5.0', + attributes: { + buildNum: 9007199254740991, + 'observability:enableInfrastructureView': true, + }, + references: [], + updated_at: '2020-06-09T20:18:20.349Z', + migrationVersion: {}, + }; + + expect(migration(doc)).toEqual({ + type: 'config', + id: '8.5.0', + attributes: { + buildNum: 9007199254740991, + }, + references: [], + updated_at: '2020-06-09T20:18:20.349Z', + migrationVersion: {}, + }); + }); +}); diff --git a/src/core/server/ui_settings/saved_objects/migrations.ts b/src/core/server/ui_settings/saved_objects/migrations.ts index 7ed65cfe61894..73b51254d1869 100644 --- a/src/core/server/ui_settings/saved_objects/migrations.ts +++ b/src/core/server/ui_settings/saved_objects/migrations.ts @@ -138,4 +138,25 @@ export const migrations = { }), references: doc.references || [], }), + '8.5.0': (doc: SavedObjectUnsanitizedDoc): SavedObjectSanitizedDoc => ({ + ...doc, + ...(doc.attributes && { + attributes: Object.keys(doc.attributes).reduce( + (acc, key) => + [ + // owner: Team:Apm + 'observability:enableInfrastructureView', + ].includes(key) + ? { + ...acc, + } + : { + ...acc, + [key]: doc.attributes[key], + }, + {} + ), + }), + references: doc.references || [], + }), }; diff --git a/src/dev/build/build_distributables.ts b/src/dev/build/build_distributables.ts index a3c2737857a68..0649c5ddc946a 100644 --- a/src/dev/build/build_distributables.ts +++ b/src/dev/build/build_distributables.ts @@ -79,17 +79,20 @@ export async function buildDistributables(log: ToolingLog, options: BuildOptions await run(Tasks.BuildCanvasShareableRuntime); } await run(Tasks.BuildKibanaPlatformPlugins); - await run(Tasks.TranspileBabel); await run(Tasks.CreatePackageJson); await run(Tasks.InstallDependencies); await run(Tasks.GeneratePackagesOptimizedAssets); - await run(Tasks.DeleteBazelPackagesFromBuildRoot); + + // Run on all source files + // **/packages need to be read + // before DeleteBazelPackagesFromBuildRoot await run(Tasks.CreateNoticeFile); await run(Tasks.CreateXPackNoticeFile); + + await run(Tasks.DeleteBazelPackagesFromBuildRoot); await run(Tasks.UpdateLicenseFile); await run(Tasks.RemovePackageJsonDeps); await run(Tasks.CleanPackageManagerRelatedFiles); - await run(Tasks.CleanTypescript); await run(Tasks.CleanExtraFilesFromModules); await run(Tasks.CleanEmptyFolders); await run(Tasks.FleetDownloadElasticGpgKey); diff --git a/src/dev/build/tasks/clean_tasks.ts b/src/dev/build/tasks/clean_tasks.ts index 38be91ad04a6a..6184c568df07d 100644 --- a/src/dev/build/tasks/clean_tasks.ts +++ b/src/dev/build/tasks/clean_tasks.ts @@ -34,20 +34,6 @@ export const CleanPackageManagerRelatedFiles: Task = { }, }; -export const CleanTypescript: Task = { - description: 'Cleaning typescript source files that have been transpiled to JS', - - async run(config, log, build) { - log.info( - 'Deleted %d files', - await scanDelete({ - directory: build.resolvePath(), - regularExpressions: [/\.(ts|tsx|d\.ts)$/, /tsconfig.*\.(json|tsbuildinfo)$/], - }) - ); - }, -}; - export const CleanExtraFilesFromModules: Task = { description: 'Cleaning tests, examples, docs, etc. from node_modules', @@ -198,7 +184,7 @@ export const CleanExtraFilesFromModules: Task = { '**/@elastic/eui/test-env', '**/@elastic/eui/optimize', '**/@elastic/eui/i18ntokens.json', - ]); + ]).concat([/\.(ts|tsx|d\.ts)$/, /tsconfig.*\.(json|tsbuildinfo)$/]); log.info( 'Deleted %d files', diff --git a/src/dev/build/tasks/copy_source_task.ts b/src/dev/build/tasks/copy_source_task.ts index 4140b142d177f..0e4407cf767b0 100644 --- a/src/dev/build/tasks/copy_source_task.ts +++ b/src/dev/build/tasks/copy_source_task.ts @@ -6,65 +6,69 @@ * Side Public License, v 1. */ -import { discoverBazelPackages } from '@kbn/bazel-packages'; +import { resolve } from 'path'; -import { copyAll, Task } from '../lib'; +import globby from 'globby'; +import Piscina from 'piscina'; + +import { Task } from '../lib'; export const CopySource: Task = { description: 'Copying source into platform-generic build directory', async run(config, log, build) { - await copyAll(config.resolveFromRepo(), build.resolvePath(), { - dot: false, - select: [ - 'yarn.lock', - '.npmrc', - 'kibana.d.ts', - 'config/kibana.yml', - 'config/node.options', - 'typings/**', - 'tsconfig*.json', - '.i18nrc.json', - 'src/**', - - 'x-pack/plugins/**', - 'x-pack/.i18nrc.json', - 'x-pack/package.json', + const select = [ + 'yarn.lock', + '.npmrc', + 'config/kibana.yml', + 'config/node.options', + '.i18nrc.json', + 'src/**', - '!{src,x-pack}/**/*.{test,test.mocks,mock,mocks}.*', - '!{src,x-pack}/**/target/**', - '!{src,x-pack}/**/{__stories__,storybook,.storybook}/**', - '!{src,x-pack}/**/{test,tests,test_resources,test_data,__tests__,manual_tests,__jest__,__snapshots__,__mocks__,mock_responses,mocks,fixtures,__fixtures__,cypress,integration_tests}/**', + 'x-pack/plugins/**', + 'x-pack/.i18nrc.json', + 'x-pack/package.json', - '!src/dev/**', - '!src/**/mocks.{js,ts}', - '!src/cli/repl/**', - '!src/cli*/dev.js', - '!src/plugins/telemetry/schema/**', - '!src/core/server/core_app/assets/favicons/favicon.distribution.{ico,png,svg}', - '!src/functional_test_runner/**', - '!src/setup_node_env/index.js', + '!src/dev/**', + '!src/**/mocks.{js,ts}', + '!src/cli*/dev.js', + '!src/plugins/telemetry/schema/**', + '!src/core/server/core_app/assets/favicons/favicon.distribution.{ico,png,svg}', + '!src/setup_node_env/index.js', - '!x-pack/plugins/**/{ftr_e2e,e2e}/**', - '!x-pack/plugins/**/scripts/**', - '!x-pack/plugins/telemetry_collection_xpack/schema/**', + '!x-pack/plugins/telemetry_collection_xpack/schema/**', - '!**/jest.config.js', - '!**/jest.config.dev.js', - '!**/jest.integration.config.js', - '!**/jest_setup.{js,ts}', - '!**/*.{story,stories}.{js,ts}', - '!**/test_mocks.ts', - '!**/*.{sh,md,mdx,asciidoc}', - '!**/*.console', - '!**/*.scss', - '!**/*.docnav.json', - '!**/{dev_docs,docs}/**', - '!**/public/**/*.{js,ts,tsx,json}', + '!**/jest*', + '!**/*.{story,stories}.{js,ts}', + '!**/test_mocks.ts', + '!**/*.{scss,console,d.ts,sh,md,mdx,asciidoc,docnav.json}', + '!**/*.{test,test.mocks,mock,mocks,spec}.*', + '!**/{packages,dev_docs,docs,public,__stories__,storybook,.storybook,ftr_e2e,e2e,scripts,test,tests,test_resources,test_data,__tests__,manual_tests,__jest__,__snapshots__,__mocks__,mock_responses,mocks,fixtures,__fixtures__,cypress,integration_tests}/**', + ]; - // explicitly ignore all bazel package locations, even if they're not selected by previous patterns - ...(await discoverBazelPackages()).map((pkg) => `!${pkg.normalizedRepoRelativeDir}/**`), - ], + const piscina = new Piscina({ + filename: resolve(__dirname, 'copy_source_worker.js'), }); + + const globbyOptions = { cwd: config.resolveFromRepo('.') }; + const tasks = ( + await Promise.all([ + globby(select, globbyOptions), + globby( + [ + '{x-pack,src}/plugins/*/public/assets/**', + 'src/plugins/data/server/scripts/**', + 'x-pack/plugins/fleet/server/services/epm/packages/**', + '!x-pack/plugins/fleet/server/services/epm/packages/*.test.ts', + ], + globbyOptions + ), + ]) + ) + .flat() + .map((source) => piscina.run({ source })); + + await Promise.all(tasks); + await piscina.destroy(); }, }; diff --git a/src/dev/build/tasks/copy_source_worker.js b/src/dev/build/tasks/copy_source_worker.js new file mode 100644 index 0000000000000..5f18cf6f46eab --- /dev/null +++ b/src/dev/build/tasks/copy_source_worker.js @@ -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. + */ + +const { writeFileSync, readFileSync, copyFileSync, mkdirSync } = require('fs'); +const { resolve, extname, dirname } = require('path'); + +const { optimize } = require('svgo'); +const { transformFileSync } = require('@babel/core'); + +const presets = require('@kbn/babel-preset/node_preset'); + +const { REPO_ROOT } = require('@kbn/utils'); +const BUILD_ROOT = resolve(REPO_ROOT, 'build', 'kibana'); + +const babelOptions = { + presets: [[presets, { 'kibana/rootDir': REPO_ROOT }]], + cwd: REPO_ROOT, + babelrc: false, + sourceMaps: false, + ast: false, +}; + +const svgOptions = { + removeComments: false, +}; + +module.exports = ({ source }) => { + const absoluteSource = resolve(REPO_ROOT, source); + const absoluteDest = resolve(BUILD_ROOT, source); + + mkdirSync(dirname(absoluteDest), { recursive: true }); + + const extension = extname(source); + switch (extension) { + case '.js': + case '.ts': + case '.tsx': + const output = transformFileSync(absoluteSource, babelOptions); + if (output.code) { + const dest = absoluteDest.substring(0, absoluteDest.lastIndexOf('.')) + '.js'; + writeFileSync(dest, output.code); + } + break; + case '.svg': + const input = readFileSync(absoluteSource, 'utf-8'); + const result = optimize(input, { + path: source, + ...svgOptions, + }); + if (result.error) throw new Error(result.error); + if (typeof result.data === 'string') { + const output = Buffer.from(result.data); + writeFileSync(absoluteDest, output); + } + break; + default: + copyFileSync(absoluteSource, absoluteDest); + } +}; diff --git a/src/dev/build/tasks/generate_packages_optimized_assets.ts b/src/dev/build/tasks/generate_packages_optimized_assets.ts index d1a8ec6d20824..0f2e22a3c1444 100644 --- a/src/dev/build/tasks/generate_packages_optimized_assets.ts +++ b/src/dev/build/tasks/generate_packages_optimized_assets.ts @@ -14,8 +14,6 @@ import fs from 'fs'; import gulpBrotli from 'gulp-brotli'; // @ts-expect-error -import gulpGzip from 'gulp-gzip'; -// @ts-expect-error import gulpPostCSS from 'gulp-postcss'; // @ts-expect-error import gulpTerser from 'gulp-terser'; @@ -66,17 +64,6 @@ async function optimizeAssets(log: ToolingLog, assetDir: string) { }), vfs.dest(assetDir) ); - - log.debug('GZip compress'); - await asyncPipeline( - vfs.src(['**/*.{js,css}'], { cwd: assetDir }), - gulpGzip({ - gzipOptions: { - level: 9, - }, - }), - vfs.dest(assetDir) - ); } finally { log.indent(-4); } diff --git a/src/dev/build/tasks/index.ts b/src/dev/build/tasks/index.ts index 4ce5ae51f34c7..51d501e78e052 100644 --- a/src/dev/build/tasks/index.ts +++ b/src/dev/build/tasks/index.ts @@ -32,7 +32,6 @@ export * from './assert_file_time'; export * from './assert_no_uuid'; export * from './assert_path_length'; export * from './replace_favicon'; -export * from './transpile_babel_task'; export * from './verify_env_task'; export * from './write_sha_sums_task'; export * from './fetch_agent_versions_list'; 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 6651b0cff0611..a44b309f03a43 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 @@ -221,6 +221,7 @@ kibana_vars=( xpack.alerting.rules.minimumScheduleInterval.value xpack.alerting.rules.minimumScheduleInterval.enforce xpack.alerting.rules.run.actions.max + xpack.alerting.rules.run.alerts.max xpack.alerting.rules.run.actions.connectorTypeOverrides xpack.alerts.healthCheck.interval xpack.alerts.invalidateApiKeysTask.interval diff --git a/src/dev/build/tasks/transpile_babel_task.ts b/src/dev/build/tasks/transpile_babel_task.ts deleted file mode 100644 index ee7d1e19de43a..0000000000000 --- a/src/dev/build/tasks/transpile_babel_task.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 { discoverBazelPackages } from '@kbn/bazel-packages'; -import { pipeline } from 'stream'; -import { promisify } from 'util'; - -// @ts-expect-error @types/gulp-babel is outdated and doesn't work for gulp-babel v8 -import gulpBabel from 'gulp-babel'; -import vfs from 'vinyl-fs'; - -import { Task, Build } from '../lib'; - -const asyncPipeline = promisify(pipeline); - -const transpileWithBabel = async (srcGlobs: string[], build: Build, preset: string) => { - const buildRoot = build.resolvePath(); - - await asyncPipeline( - vfs.src( - srcGlobs.concat([ - '!**/*.d.ts', - '!**/node_modules/**', - '!**/bower_components/**', - '!**/__tests__/**', - ...(await discoverBazelPackages()).map((pkg) => `!${pkg.normalizedRepoRelativeDir}/**`), - ]), - { - cwd: buildRoot, - } - ), - - gulpBabel({ - babelrc: false, - presets: [ - [ - preset, - { - // we pass this so that @kbn/babel-plugin-synthetic-packages can correct absolute imports - // for packages to relative requests, without having to discover the Kibana repo root, which - // it can't do because at this point in the build there isn't a package.json file for the - // plugin to find. - 'kibana/rootDir': build.resolvePath('.'), - }, - ], - ], - }), - - vfs.dest(buildRoot) - ); -}; - -export const TranspileBabel: Task = { - description: 'Transpiling sources with babel', - - async run(config, log, build) { - // Transpile server code - await transpileWithBabel( - ['**/*.{js,ts,tsx}', '!**/public/**'], - build, - require.resolve('@kbn/babel-preset/node_preset') - ); - - // Transpile client code - // NOTE: For the client, as we have the optimizer, we are only - // pre-transpiling the typescript based files - await transpileWithBabel( - ['**/public/**/*.{ts,tsx}'], - build, - require.resolve('@kbn/babel-preset/webpack_preset') - ); - }, -}; diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index 02649c2fc5b88..fea4d101c64ea 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -67,6 +67,7 @@ export const LICENSE_ALLOWED = [ 'WTFPL', 'Nuclide software', 'Python-2.0', + '(Apache-2.0 AND MIT)', ]; // The following list only applies to licenses that diff --git a/src/dev/notice/generate_notice_from_source.ts b/src/dev/notice/generate_notice_from_source.ts index 8d162154bc5f0..7abfce7891c1a 100644 --- a/src/dev/notice/generate_notice_from_source.ts +++ b/src/dev/notice/generate_notice_from_source.ts @@ -6,7 +6,10 @@ * Side Public License, v 1. */ -import vfs from 'vinyl-fs'; +import { readFile } from 'fs/promises'; +import { relative } from 'path'; +import globby from 'globby'; + import { ToolingLog } from '@kbn/tooling-log'; const NOTICE_COMMENT_RE = /\/\*[\s\n\*]*@notice([\w\W]+?)\*\//g; @@ -30,45 +33,37 @@ interface Options { * into the repository. */ export async function generateNoticeFromSource({ productName, directory, log }: Options) { - const globs = ['**/*.{js,less,css,ts,tsx}']; - - const options = { - cwd: directory, - nodir: true, - ignore: [ - '{node_modules,build,dist,data,built_assets}/**', - 'packages/*/{node_modules,build,dist}/**', - 'src/plugins/*/{node_modules,build,dist}/**', - 'x-pack/{node_modules,build,dist,data}/**', - 'x-pack/packages/*/{node_modules,build,dist}/**', - 'x-pack/plugins/**/{node_modules,build,dist}/**', - '**/target/**', - ], - }; + const select = [ + '**/*.{js,mjs,scss,css,ts,tsx}', + '!{node_modules,build,dist,data,built_assets,shared_built_assets}/**', + '!packages/*/{node_modules,build,dist}/**', + '!src/plugins/*/{node_modules,build,dist}/**', + '!x-pack/{node_modules,build,dist,data}/**', + '!x-pack/packages/*/{node_modules,build,dist}/**', + '!x-pack/plugins/**/{node_modules,build,dist}/**', + '!**/target/**', + ]; - log.debug('vfs.src globs', globs); - log.debug('vfs.src options', options); log.info(`Searching ${directory} for multi-line comments starting with @notice`); - const files = vfs.src(globs, options); - const noticeComments: string[] = []; - await new Promise((resolve, reject) => { - files - .on('data', (file) => { - log.verbose(`Checking for @notice comments in ${file.relative}`); - - const source = file.contents.toString('utf8'); - let match; - while ((match = NOTICE_COMMENT_RE.exec(source)) !== null) { - log.info(`Found @notice comment in ${file.relative}`); - if (!noticeComments.includes(match[1])) { - noticeComments.push(match[1]); - } - } - }) - .on('error', reject) - .on('end', resolve); + const files = globby.stream(select, { + cwd: directory, + followSymbolicLinks: false, + absolute: true, }); + const noticeComments: string[] = []; + for await (const file of files) { + const source = await readFile(file, 'utf-8'); + const relativeFile = relative(directory, file.toString()); + log.verbose(`Checking for @notice comments in ${relativeFile}`); + let match; + while ((match = NOTICE_COMMENT_RE.exec(source)) !== null) { + log.info(`Found @notice comment in ${relativeFile}`); + if (!noticeComments.includes(match[1])) { + noticeComments.push(match[1]); + } + } + } let noticeText = ''; noticeText += `${productName}\n`; diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 0c65b924f14b1..418a8f448b2c8 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -54,7 +54,7 @@ export const IGNORE_FILE_GLOBS = [ '**/preview-head.html', // filename must match upstream filenames from lodash - 'packages/elastic-safer-lodash-set/**/*', + 'packages/kbn-safer-lodash-set/**/*', // filename must match upstream filenames from handlebars 'packages/kbn-handlebars/src/upstream/**/*', diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 89e78848a1366..7bb26e526be3d 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -13,6 +13,7 @@ export const storybookAliases = { ci_composite: '.ci/.storybook', cloud: 'x-pack/plugins/cloud/.storybook', coloring: 'packages/kbn-coloring/.storybook', + chart_icons: 'packages/kbn-chart-icons/.storybook', controls: 'src/plugins/controls/storybook', custom_integrations: 'src/plugins/custom_integrations/storybook', dashboard_enhanced: 'x-pack/plugins/dashboard_enhanced/.storybook', @@ -38,7 +39,7 @@ export const storybookAliases = { observability: 'x-pack/plugins/observability/.storybook', presentation: 'src/plugins/presentation_util/storybook', security_solution: 'x-pack/plugins/security_solution/.storybook', - shared_ux: 'packages/kbn-shared-ux-storybook/src/config', + shared_ux: 'packages/shared-ux/storybook/config', threat_intelligence: 'x-pack/plugins/threat_intelligence/.storybook', ui_actions_enhanced: 'src/plugins/ui_actions_enhanced/.storybook', unified_search: 'src/plugins/unified_search/.storybook', diff --git a/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.tsx b/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.tsx index 232b522838b8e..b75d613f814a7 100644 --- a/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.tsx +++ b/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.tsx @@ -21,7 +21,6 @@ import { } from '../../common'; import { getAccessorsFromArgs, - getIcons, getMaxValue, getMinValue, getValueFromAccessor, @@ -29,6 +28,7 @@ import { getGoalConfig, computeMinMax, } from './utils'; +import { getIcons } from './utils/icons'; import './index.scss'; import { GaugeCentralMajorMode } from '../../common/types'; import { isBulletShape, isRoundShape } from '../../common/utils'; diff --git a/src/plugins/chart_expressions/expression_gauge/public/components/utils/icons.ts b/src/plugins/chart_expressions/expression_gauge/public/components/utils/icons.ts index 734c64d579da3..33d8427892392 100644 --- a/src/plugins/chart_expressions/expression_gauge/public/components/utils/icons.ts +++ b/src/plugins/chart_expressions/expression_gauge/public/components/utils/icons.ts @@ -6,13 +6,13 @@ * Side Public License, v 1. */ +import { IconChartHorizontalBullet, IconChartVerticalBullet } from '@kbn/chart-icons'; import { GaugeShape, GaugeShapes } from '../../../common'; -import { HorizontalBulletIcon } from '../icons'; export const getIcons = (type: GaugeShape) => ({ - [GaugeShapes.HORIZONTAL_BULLET]: HorizontalBulletIcon, - [GaugeShapes.VERTICAL_BULLET]: HorizontalBulletIcon, + [GaugeShapes.HORIZONTAL_BULLET]: IconChartHorizontalBullet, + [GaugeShapes.VERTICAL_BULLET]: IconChartVerticalBullet, [GaugeShapes.ARC]: 'visGoal', [GaugeShapes.CIRCLE]: 'visGoal', }[type]); diff --git a/src/plugins/chart_expressions/expression_gauge/public/components/utils/index.ts b/src/plugins/chart_expressions/expression_gauge/public/components/utils/index.ts index 87f6a520ff9eb..639c2a7821b55 100644 --- a/src/plugins/chart_expressions/expression_gauge/public/components/utils/index.ts +++ b/src/plugins/chart_expressions/expression_gauge/public/components/utils/index.ts @@ -7,7 +7,6 @@ */ export * from './accessors'; -export * from './icons'; export * from './gauge_types'; export * from './goal_config'; diff --git a/src/plugins/chart_expressions/expression_gauge/public/index.ts b/src/plugins/chart_expressions/expression_gauge/public/index.ts index 6f9924759e4c4..fc40382a8702a 100644 --- a/src/plugins/chart_expressions/expression_gauge/public/index.ts +++ b/src/plugins/chart_expressions/expression_gauge/public/index.ts @@ -13,4 +13,3 @@ export function plugin() { } export { getGoalValue, getMaxValue, getMinValue, getValueFromAccessor } from './components/utils'; -export { VerticalBulletIcon, HorizontalBulletIcon } from './components/icons'; diff --git a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx index 35a3d54fe58c0..f2db5a25ff429 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx +++ b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx @@ -35,6 +35,7 @@ import { LegendSizeToPixels, } from '@kbn/visualizations-plugin/common/constants'; import { DatatableColumn } from '@kbn/expressions-plugin/public'; +import { IconChartHeatmap } from '@kbn/chart-icons'; import type { HeatmapRenderProps, FilterEvent, BrushEvent } from '../../common'; import { applyPaletteParams, @@ -47,7 +48,6 @@ import { LegendColorPickerWrapper, } from '../utils/get_color_picker'; import { defaultPaletteParams } from '../constants'; -import { HeatmapIcon } from './heatmap_icon'; import './index.scss'; declare global { @@ -366,7 +366,7 @@ export const HeatmapComponent: FC = memo( ); if (!chartData || !chartData.length) { - return ; + return ; } if (!yAxisColumn) { @@ -567,7 +567,9 @@ export const HeatmapComponent: FC = memo( } + noResults={ + + } onElementClick={interactive ? (onElementClick as ElementClickListener) : undefined} showLegend={showLegend ?? args.legend.isVisible} legendPosition={args.legend.position} diff --git a/src/plugins/chart_expressions/expression_heatmap/public/index.ts b/src/plugins/chart_expressions/expression_heatmap/public/index.ts index f6aa926a8fef2..fbbf8027eb343 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/index.ts +++ b/src/plugins/chart_expressions/expression_heatmap/public/index.ts @@ -11,5 +11,3 @@ import { ExpressionHeatmapPlugin } from './plugin'; export function plugin() { return new ExpressionHeatmapPlugin(); } - -export { HeatmapIcon } from './components/heatmap_icon'; diff --git a/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts b/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts index d01a2400e038a..10067f702d906 100644 --- a/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts +++ b/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts @@ -102,6 +102,7 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({ fn(input, args, handlers) { validateAccessor(args.metric, input.columns); validateAccessor(args.secondaryMetric, input.columns); + validateAccessor(args.max, input.columns); validateAccessor(args.breakdownBy, input.columns); if (handlers?.inspectorAdapters?.tables) { diff --git a/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.test.tsx b/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.test.tsx index 31a12f702ae2a..c94a0688588a1 100644 --- a/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.test.tsx +++ b/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.test.tsx @@ -253,7 +253,7 @@ describe('MetricVisComponent', function () { } `); }); - it('should display subtitle and secondary prefix', () => { + it('should display subtitle', () => { const component = shallow( , - "subtitle": "subtitle", - "title": "Median products.base_price", - "value": 28.984375, - "valueFormatter": [Function], - } - `); }); it('should display secondary metric', () => { - const component = shallow( - + const getMetricConfig = (localConfig: MetricVisComponentProps['config']) => + shallow() + .find(Metric) + .props().data![0][0]!; + + const configNoPrefix = getMetricConfig({ + ...config, + metric: { ...config.metric, subtitle: 'subtitle', secondaryPrefix: undefined }, + dimensions: { ...config.dimensions, secondaryMetric: minPriceColumnId }, + }); + + expect(configNoPrefix!.extra).toEqual( + + {table.columns.find((col) => col.id === minPriceColumnId)!.name} + {' ' + 13.63} + ); - const [[visConfig]] = component.find(Metric).props().data!; + const configWithPrefix = getMetricConfig({ + ...config, + metric: { ...config.metric, subtitle: 'subtitle', secondaryPrefix: 'secondary prefix' }, + dimensions: { ...config.dimensions, secondaryMetric: minPriceColumnId }, + }); - expect(visConfig!.extra).toEqual( + expect(configWithPrefix!.extra).toEqual( {'secondary prefix'} {' ' + 13.63} ); - expect(visConfig).toMatchInlineSnapshot(` + expect(configWithPrefix).toMatchInlineSnapshot(` Object { "color": "#f5f7fa", "extra": @@ -754,6 +753,7 @@ describe('MetricVisComponent', function () { /> ) .find('div') + .at(0) .props() as HtmlAttributes & { css: { styles: string } } ).css.styles; @@ -763,6 +763,7 @@ describe('MetricVisComponent', function () { width: 100%; max-height: 100%; max-width: 100%; + overflow-y: auto; " `); @@ -772,6 +773,7 @@ describe('MetricVisComponent', function () { width: 300px; max-height: 100%; max-width: 100%; + overflow-y: auto; " `); @@ -781,6 +783,7 @@ describe('MetricVisComponent', function () { width: 1000px; max-height: 100%; max-width: 100%; + overflow-y: auto; " `); }); @@ -1213,5 +1216,16 @@ describe('MetricVisComponent', function () { }, }); }); + + it('ignores suffix formatting', () => { + const { primary, secondary } = getFormattedMetrics(0.23939, 11.2, { + id: 'suffix', + params: { + id: 'percent', + }, + }); + expect(primary).toBe('23.94%'); + expect(secondary).toBe('1.12K%'); + }); }); }); diff --git a/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.tsx b/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.tsx index 94fd86ea43daa..05a0266e676d0 100644 --- a/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.tsx +++ b/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { useCallback, useEffect, useRef } from 'react'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; import numeral from '@elastic/numeral'; import { i18n } from '@kbn/i18n'; @@ -34,6 +34,7 @@ import type { FieldFormatConvertFunction } from '@kbn/field-formats-plugin/commo import { CUSTOM_PALETTE } from '@kbn/coloring'; import { css } from '@emotion/react'; import { euiThemeVars } from '@kbn/ui-theme'; +import { useResizeObserver } from '@elastic/eui'; import { VisParams } from '../../common'; import { getPaletteService, @@ -79,7 +80,10 @@ const getMetricFormatter = ( columns: Datatable['columns'] ) => { const serializedFieldFormat = getFormatByAccessor(accessor, columns); - const formatId = serializedFieldFormat?.id ?? 'number'; + const formatId = + (serializedFieldFormat?.id === 'suffix' + ? serializedFieldFormat.params?.id + : serializedFieldFormat?.id) ?? 'number'; if ( !['number', 'currency', 'percent', 'bytes', 'duration', 'string', 'null'].includes(formatId) @@ -159,16 +163,11 @@ const getColor = ( data: Datatable, rowNumber: number ) => { - let minBound = paletteParams.rangeMin; - let maxBound = paletteParams.rangeMax; - const { min, max } = getDataBoundsForPalette(accessors, data, rowNumber); - minBound = min; - maxBound = max; return getPaletteService().get(CUSTOM_PALETTE)?.getColorForValue?.(value, paletteParams, { - min: minBound, - max: maxBound, + min, + max, }); }; @@ -243,6 +242,7 @@ export const MetricVis = ({ ? formatBreakdownValue(row[breakdownByColumn.id]) : primaryMetricColumn.name; const subtitle = breakdownByColumn ? primaryMetricColumn.name : config.metric.subtitle; + const secondaryPrefix = config.metric.secondaryPrefix ?? secondaryMetricColumn?.name; return { value, valueFormatter: formatPrimaryMetric, @@ -250,9 +250,9 @@ export const MetricVis = ({ subtitle, extra: ( - {config.metric.secondaryPrefix} + {secondaryPrefix} {secondaryMetricColumn - ? `${config.metric.secondaryPrefix ? ' ' : ''}${formatSecondaryMetric!( + ? `${secondaryPrefix ? ' ' : ''}${formatSecondaryMetric!( row[secondaryMetricColumn.id] )}` : undefined} @@ -307,6 +307,20 @@ export const MetricVis = ({ pixelWidth = grid[0]?.length * maxTileSideLength; } + const [scrollChildHeight, setScrollChildHeight] = useState('100%'); + const scrollContainerRef = useRef(null); + const scrollDimensions = useResizeObserver(scrollContainerRef.current); + + useEffect(() => { + const minTileHeight = 64; // TODO - magic number from the @elastic/charts side. would be nice to deduplicate + const minimumRequiredVerticalSpace = minTileHeight * grid.length; + setScrollChildHeight( + (scrollDimensions.height ?? -Infinity) > minimumRequiredVerticalSpace + ? '100%' + : `${minimumRequiredVerticalSpace}px` + ); + }, [grid.length, scrollDimensions.height]); + // force chart to re-render to circumvent a charts bug const magicKey = useRef(0); useEffect(() => { @@ -315,45 +329,53 @@ export const MetricVis = ({ return (
- - + + { - if (!filterable) { - return; - } - events.forEach((event) => { - if (isMetricElementEvent(event)) { - const colIdx = breakdownByColumn - ? data.columns.findIndex((col) => col === breakdownByColumn) - : data.columns.findIndex((col) => col === primaryMetricColumn); - const rowLength = grid[0].length; - fireEvent( - buildFilterEvent(event.rowIndex * rowLength + event.columnIndex, colIdx, data) - ); + chartTheme, + ]} + onRenderChange={onRenderChange} + onElementClick={(events) => { + if (!filterable) { + return; } - }); - }} - /> - - + events.forEach((event) => { + if (isMetricElementEvent(event)) { + const colIdx = breakdownByColumn + ? data.columns.findIndex((col) => col === breakdownByColumn) + : data.columns.findIndex((col) => col === primaryMetricColumn); + const rowLength = grid[0].length; + fireEvent( + buildFilterEvent(event.rowIndex * rowLength + event.columnIndex, colIdx, data) + ); + } + }); + }} + /> + + +
); }; diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/icons/donut.tsx b/src/plugins/chart_expressions/expression_partition_vis/public/icons/donut.tsx deleted file mode 100644 index 3101164bfe88d..0000000000000 --- a/src/plugins/chart_expressions/expression_partition_vis/public/icons/donut.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React from 'react'; -import { EuiIconProps } from '@elastic/eui'; -import { useCommonChartStyles } from '@kbn/charts-plugin/public'; - -export const DonutIcon = ({ title, titleId, ...props }: Omit) => { - const { chartIcon } = useCommonChartStyles(); - - return ( - - {title ? {title} : null} - - - - ); -}; diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/icons/index.ts b/src/plugins/chart_expressions/expression_partition_vis/public/icons/index.ts deleted file mode 100644 index e61bd6557d581..0000000000000 --- a/src/plugins/chart_expressions/expression_partition_vis/public/icons/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 { PieIcon } from './pie'; -export { DonutIcon } from './donut'; -export { TreemapIcon } from './treemap'; -export { MosaicIcon } from './mosaic'; -export { WaffleIcon } from './waffle'; diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/icons/mosaic.tsx b/src/plugins/chart_expressions/expression_partition_vis/public/icons/mosaic.tsx deleted file mode 100644 index 1f5c99702f869..0000000000000 --- a/src/plugins/chart_expressions/expression_partition_vis/public/icons/mosaic.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React from 'react'; -import type { EuiIconProps } from '@elastic/eui'; -import { useCommonChartStyles } from '@kbn/charts-plugin/public'; - -export const MosaicIcon = ({ title, titleId, ...props }: Omit) => { - const { chartIcon } = useCommonChartStyles(); - - return ( - - {title ? : null} - - - - ); -}; diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/icons/pie.tsx b/src/plugins/chart_expressions/expression_partition_vis/public/icons/pie.tsx deleted file mode 100644 index 5824b8f40b6e6..0000000000000 --- a/src/plugins/chart_expressions/expression_partition_vis/public/icons/pie.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React from 'react'; -import { EuiIconProps } from '@elastic/eui'; -import { useCommonChartStyles } from '@kbn/charts-plugin/public'; - -export const PieIcon = ({ title, titleId, ...props }: Omit) => { - const { chartIcon } = useCommonChartStyles(); - - return ( - - {title ? {title} : null} - - - - ); -}; diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/icons/treemap.tsx b/src/plugins/chart_expressions/expression_partition_vis/public/icons/treemap.tsx deleted file mode 100644 index 781b79505384d..0000000000000 --- a/src/plugins/chart_expressions/expression_partition_vis/public/icons/treemap.tsx +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; -import { useCommonChartStyles } from '@kbn/charts-plugin/public'; - -export const TreemapIcon = ({ title, titleId, ...props }: Omit) => { - const { chartIcon } = useCommonChartStyles(); - - return ( - - {title ? {title} : null} - - - - - ); -}; diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/icons/waffle.tsx b/src/plugins/chart_expressions/expression_partition_vis/public/icons/waffle.tsx deleted file mode 100644 index 21e26facd8e15..0000000000000 --- a/src/plugins/chart_expressions/expression_partition_vis/public/icons/waffle.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React from 'react'; -import type { EuiIconProps } from '@elastic/eui'; -import { useCommonChartStyles } from '@kbn/charts-plugin/public'; - -export const WaffleIcon = ({ title, titleId, ...props }: Omit) => { - const { chartIcon } = useCommonChartStyles(); - - return ( - - {title ? : null} - - - - ); -}; diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/utils/get_icon.ts b/src/plugins/chart_expressions/expression_partition_vis/public/utils/get_icon.ts index cac282553af11..d8b5ad858d764 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/public/utils/get_icon.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/public/utils/get_icon.ts @@ -6,14 +6,20 @@ * Side Public License, v 1. */ +import { + IconChartWaffle, + IconChartMosaic, + IconChartPie, + IconChartDonut, + IconChartTreemap, +} from '@kbn/chart-icons'; import { ChartTypes } from '../../common/types'; -import { PieIcon, DonutIcon, TreemapIcon, MosaicIcon, WaffleIcon } from '../icons'; export const getIcon = (chart: ChartTypes) => ({ - [ChartTypes.PIE]: PieIcon, - [ChartTypes.DONUT]: DonutIcon, - [ChartTypes.TREEMAP]: TreemapIcon, - [ChartTypes.MOSAIC]: MosaicIcon, - [ChartTypes.WAFFLE]: WaffleIcon, + [ChartTypes.PIE]: IconChartPie, + [ChartTypes.DONUT]: IconChartDonut, + [ChartTypes.TREEMAP]: IconChartTreemap, + [ChartTypes.MOSAIC]: IconChartMosaic, + [ChartTypes.WAFFLE]: IconChartWaffle, }[chart]); diff --git a/src/plugins/chart_expressions/expression_xy/common/index.ts b/src/plugins/chart_expressions/expression_xy/common/index.ts index d9c415f488839..da4c969f47a0c 100755 --- a/src/plugins/chart_expressions/expression_xy/common/index.ts +++ b/src/plugins/chart_expressions/expression_xy/common/index.ts @@ -47,6 +47,7 @@ export type { ReferenceLineLayerArgs, CommonXYDataLayerConfig, ReferenceLineLayerConfig, + DataDecorationConfigResult, AvailableReferenceLineIcon, XYExtendedLayerConfigResult, CommonXYAnnotationLayerConfig, diff --git a/src/plugins/chart_expressions/expression_xy/public/definitions/visualizations.ts b/src/plugins/chart_expressions/expression_xy/public/definitions/visualizations.ts index bb4acd7fa50de..4f4d8aeb69959 100644 --- a/src/plugins/chart_expressions/expression_xy/public/definitions/visualizations.ts +++ b/src/plugins/chart_expressions/expression_xy/public/definitions/visualizations.ts @@ -6,30 +6,33 @@ * Side Public License, v 1. */ -import { SeriesTypes } from '../../common/constants'; import { - BarIcon, - LineIcon, - AreaIcon, - BarStackedIcon, - AreaStackedIcon, - BarHorizontalIcon, - BarPercentageIcon, - AreaPercentageIcon, - BarHorizontalStackedIcon, - BarHorizontalPercentageIcon, -} from '../icons'; + IconChartBarHorizontalPercentage, + IconChartBarHorizontalStacked, + IconChartBarPercentage, + IconChartBarHorizontal, + IconChartAreaStacked, + IconChartBarStacked, + IconChartLine, + IconChartBar, + IconChartArea, + IconChartAreaPercentage, +} from '@kbn/chart-icons'; +import { SeriesTypes } from '../../common/constants'; export const visualizationDefinitions = [ - { id: SeriesTypes.BAR, icon: BarIcon }, - { id: `${SeriesTypes.BAR}_stacked`, icon: BarStackedIcon }, - { id: `${SeriesTypes.BAR}_horizontal`, icon: BarHorizontalIcon }, - { id: `${SeriesTypes.BAR}_percentage_stacked`, icon: BarPercentageIcon }, - { id: `${SeriesTypes.BAR}_horizontal_stacked`, icon: BarHorizontalStackedIcon }, - { id: `${SeriesTypes.BAR}_horizontal_percentage_stacked`, icon: BarHorizontalPercentageIcon }, - { id: SeriesTypes.LINE, icon: LineIcon }, - { id: `${SeriesTypes.LINE}_stacked`, icon: LineIcon }, - { id: SeriesTypes.AREA, icon: AreaIcon }, - { id: `${SeriesTypes.AREA}_stacked`, icon: AreaStackedIcon }, - { id: `${SeriesTypes.AREA}_percentage_stacked`, icon: AreaPercentageIcon }, + { id: SeriesTypes.BAR, icon: IconChartBar }, + { id: `${SeriesTypes.BAR}_stacked`, icon: IconChartBarStacked }, + { id: `${SeriesTypes.BAR}_horizontal`, icon: IconChartBarHorizontal }, + { id: `${SeriesTypes.BAR}_percentage_stacked`, icon: IconChartBarPercentage }, + { id: `${SeriesTypes.BAR}_horizontal_stacked`, icon: IconChartBarHorizontalStacked }, + { + id: `${SeriesTypes.BAR}_horizontal_percentage_stacked`, + icon: IconChartBarHorizontalPercentage, + }, + { id: `${SeriesTypes.LINE}_stacked`, icon: IconChartLine }, + { id: SeriesTypes.LINE, icon: IconChartLine }, + { id: SeriesTypes.AREA, icon: IconChartArea }, + { id: `${SeriesTypes.AREA}_stacked`, icon: IconChartAreaStacked }, + { id: `${SeriesTypes.AREA}_percentage_stacked`, icon: IconChartAreaPercentage }, ]; diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.test.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.test.ts index 35019d75e0554..183a798056edb 100644 --- a/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.test.ts +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.test.ts @@ -7,7 +7,7 @@ */ import { FieldFormat } from '@kbn/field-formats-plugin/common'; -import { DataLayerConfig, YAxisConfigResult } from '../../common'; +import { DataLayerConfig, YAxisConfigResult, DataDecorationConfigResult } from '../../common'; import { LayerTypes } from '../../common/constants'; import { Datatable } from '@kbn/expressions-plugin/public'; import { getAxesConfiguration } from './axes_configuration'; @@ -218,6 +218,20 @@ describe('axes_configuration', () => { params: { id: 'currency' }, }, }, + { + id: 'yAccessorId5', + name: 'Other column', + meta: { + type: 'number', + source: 'esaggs', + index: 'indexPatternId', + sourceParams: { + indexPatternId: 'indexPatternId', + type: 'count', + }, + params: { id: 'number' }, + }, + }, ], }, }; @@ -228,6 +242,11 @@ describe('axes_configuration', () => { position: 'right', type: 'yAxisConfig', }, + { + id: '2', + position: 'left', + type: 'yAxisConfig', + }, ]; const sampleLayer: DataLayerConfig = { @@ -256,6 +275,7 @@ describe('axes_configuration', () => { yAccessorId: { id: 'number', params: {} }, yAccessorId3: { id: 'currency', params: {} }, yAccessorId4: { id: 'currency', params: {} }, + yAccessorId5: { id: 'number', params: {} }, }, splitSeriesAccessors: { d: { format: { id: 'number', params: {} }, formatter: {} as FieldFormat }, @@ -269,11 +289,35 @@ describe('axes_configuration', () => { const formatFactory = jest.fn(); const groups = getAxesConfiguration([sampleLayer], false, formatFactory, fieldFormats, []); expect(groups.length).toEqual(1); + expect(groups[0].groupId).toEqual('left'); expect(groups[0].position).toEqual('left'); expect(groups[0].series[0].accessor).toEqual('yAccessorId'); expect(groups[0].series[0].layer).toEqual('first'); }); + it('should map auto series to defined left axis if formatters match', () => { + const formatFactory = jest.fn(); + const groups = getAxesConfiguration( + [ + { + ...sampleLayer, + accessors: ['yAccessorId', 'yAccessorId5'], + decorations: [{ type: 'dataDecorationConfig', forAccessor: 'yAccessorId', axisId: '2' }], + }, + ], + false, + formatFactory, + fieldFormats, + yAxisConfigs + ); + expect(groups.length).toEqual(1); + expect(groups[0].groupId).toEqual('axis-2'); + expect(groups[0].position).toEqual('left'); + expect(groups[0].series[0].accessor).toEqual('yAccessorId'); + expect(groups[0].series[1].accessor).toEqual('yAccessorId5'); + expect(groups[0].series[0].layer).toEqual('first'); + }); + it('should map auto series to right axis if formatters do not match', () => { const formatFactory = jest.fn(); const twoSeriesLayer = { ...sampleLayer, accessors: ['yAccessorId', 'yAccessorId2'] }; @@ -285,13 +329,72 @@ describe('axes_configuration', () => { expect(groups[1].series[0].accessor).toEqual('yAccessorId2'); }); - it('should map auto series to left if left and right are already filled with non-matching series', () => { + it('should map auto series to left axis if formatters do not match with defined left axis', () => { + const formatFactory = jest.fn(); + const groups = getAxesConfiguration( + [ + { + ...sampleLayer, + accessors: ['yAccessorId', 'yAccessorId3'], + decorations: [{ type: 'dataDecorationConfig', forAccessor: 'yAccessorId', axisId: '2' }], + }, + ], + false, + formatFactory, + fieldFormats, + yAxisConfigs + ); + expect(groups.length).toEqual(2); + expect(groups[0].groupId).toEqual('axis-2'); + expect(groups[0].position).toEqual('left'); + expect(groups[0].series[0].accessor).toEqual('yAccessorId'); + expect(groups[0].series[0].layer).toEqual('first'); + expect(groups[1].groupId).toEqual('right'); + expect(groups[1].position).toEqual('right'); + expect(groups[1].series[0].accessor).toEqual('yAccessorId3'); + expect(groups[1].series[0].layer).toEqual('first'); + }); + + it('should map auto series to defined left axis if defined left and right are already filled with non-matching series', () => { + const formatFactory = jest.fn(); + const threeSeriesLayer = { + ...sampleLayer, + accessors: ['yAccessorId', 'yAccessorId2', 'yAccessorId3'], + decorations: [ + { type: 'dataDecorationConfig', forAccessor: 'yAccessorId', axisId: '1' }, + { type: 'dataDecorationConfig', forAccessor: 'yAccessorId2', axisId: '2' }, + ] as DataDecorationConfigResult[], + }; + const groups = getAxesConfiguration( + [threeSeriesLayer], + false, + formatFactory, + fieldFormats, + yAxisConfigs + ); + expect(groups.length).toEqual(2); + expect(groups[0].groupId).toEqual('axis-1'); + expect(groups[0].position).toEqual('right'); + expect(groups[1].groupId).toEqual('axis-2'); + expect(groups[1].position).toEqual('left'); + expect(groups[0].series[0].accessor).toEqual('yAccessorId'); + expect(groups[1].series[0].accessor).toEqual('yAccessorId2'); + expect(groups[1].series[1].accessor).toEqual('yAccessorId3'); + }); + + it('should map auto series to left if not-defined left and right are already filled with non-matching series', () => { const formatFactory = jest.fn(); const threeSeriesLayer = { ...sampleLayer, accessors: ['yAccessorId', 'yAccessorId2', 'yAccessorId3'], }; - const groups = getAxesConfiguration([threeSeriesLayer], false, formatFactory, fieldFormats, []); + const groups = getAxesConfiguration( + [threeSeriesLayer], + false, + formatFactory, + fieldFormats, + yAxisConfigs + ); expect(groups.length).toEqual(2); expect(groups[0].position).toEqual('left'); expect(groups[1].position).toEqual('right'); diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.ts index f95423ea83854..7f9f6c49824b8 100644 --- a/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.ts +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.ts @@ -113,8 +113,13 @@ export function groupAxesByType( const tablesExist = layers.filter(({ table }) => Boolean(table)).length > 0; - leftSeriesKeys.push(LEFT_GLOBAL_AXIS_ID); - rightSeriesKeys.push(RIGHT_GLOBAL_AXIS_ID); + if (!leftSeriesKeys.length) { + leftSeriesKeys.push(LEFT_GLOBAL_AXIS_ID); + } + + if (!rightSeriesKeys.length) { + rightSeriesKeys.push(RIGHT_GLOBAL_AXIS_ID); + } series.auto.forEach((currentSeries) => { const leftAxisGroupId = tablesExist @@ -129,16 +134,23 @@ export function groupAxesByType( ) : undefined; - let axisGroupId = LEFT_GLOBAL_AXIS_ID; - - if (series[LEFT_GLOBAL_AXIS_ID].length === 0 || leftAxisGroupId) { - axisGroupId = leftAxisGroupId || LEFT_GLOBAL_AXIS_ID; - } else if (series[RIGHT_GLOBAL_AXIS_ID].length === 0 || rightAxisGroupId) { - axisGroupId = rightAxisGroupId || RIGHT_GLOBAL_AXIS_ID; - } else if (series[RIGHT_GLOBAL_AXIS_ID].length >= series[LEFT_GLOBAL_AXIS_ID].length) { - axisGroupId = LEFT_GLOBAL_AXIS_ID; + const rightSeriesCount = rightSeriesKeys.reduce((acc, key) => { + return acc + series[key].length; + }, 0); + const leftSeriesCount = leftSeriesKeys.reduce((acc, key) => { + return acc + series[key].length; + }, 0); + + let axisGroupId; + + if (leftSeriesCount === 0 || leftAxisGroupId) { + axisGroupId = leftAxisGroupId || leftSeriesKeys[0]; + } else if (rightSeriesCount === 0 || rightAxisGroupId) { + axisGroupId = rightAxisGroupId || rightSeriesKeys[0]; + } else if (rightSeriesCount >= leftSeriesCount) { + axisGroupId = leftSeriesKeys[0]; } else { - axisGroupId = RIGHT_GLOBAL_AXIS_ID; + axisGroupId = rightSeriesKeys[0]; } series[axisGroupId].push(currentSeries); diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/icon.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/icon.ts index 8b4113b3ada11..a74d4196f487d 100644 --- a/src/plugins/chart_expressions/expression_xy/public/helpers/icon.ts +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/icon.ts @@ -7,7 +7,7 @@ */ import { i18n } from '@kbn/i18n'; -import { TriangleIcon, CircleIcon } from '../icons'; +import { IconTriangle, IconCircle } from '@kbn/chart-icons'; import { AvailableReferenceLineIcons } from '../../common/constants'; export function hasIcon(icon: string | undefined): icon is string { @@ -56,7 +56,7 @@ export const iconSet = [ label: i18n.translate('expressionXY.xyChart.iconSelect.circleIconLabel', { defaultMessage: 'Circle', }), - icon: CircleIcon, + icon: IconCircle, canFill: true, }, @@ -105,7 +105,7 @@ export const iconSet = [ label: i18n.translate('expressionXY.xyChart.iconSelect.triangleIconLabel', { defaultMessage: 'Triangle', }), - icon: TriangleIcon, + icon: IconTriangle, shouldRotate: true, canFill: true, }, diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/area_percentage.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/area_percentage.tsx deleted file mode 100644 index a51e66b68ba93..0000000000000 --- a/src/plugins/chart_expressions/expression_xy/public/icons/area_percentage.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; - -export const AreaPercentageIcon = ({ title, titleId, ...props }: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/area_stacked.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/area_stacked.tsx deleted file mode 100644 index c2b9fbe926328..0000000000000 --- a/src/plugins/chart_expressions/expression_xy/public/icons/area_stacked.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; - -export const AreaStackedIcon = ({ title, titleId, ...props }: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar_reference_line.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/bar_reference_line.tsx deleted file mode 100644 index 95bd8e2a8d0a2..0000000000000 --- a/src/plugins/chart_expressions/expression_xy/public/icons/bar_reference_line.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const BarReferenceLineIcon = ({ title, titleId, ...props }: Omit) => ( - - {title ? {title} : null} - - - - - -); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/index.ts b/src/plugins/chart_expressions/expression_xy/public/icons/index.ts deleted file mode 100644 index 4ca0b640a3d89..0000000000000 --- a/src/plugins/chart_expressions/expression_xy/public/icons/index.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 { BarHorizontalPercentageIcon } from './bar_horizontal_percentage'; -export { BarHorizontalStackedIcon } from './bar_horizontal_stacked'; -export { BarReferenceLineIcon } from './bar_reference_line'; -export { AreaPercentageIcon } from './area_percentage'; -export { BarHorizontalIcon } from './bar_horizontal'; -export { BarPercentageIcon } from './bar_percentage'; -export { AreaStackedIcon } from './area_stacked'; -export { BarStackedIcon } from './bar_stacked'; -export { TriangleIcon } from './triangle'; -export { MixedXyIcon } from './mixed_xy'; -export { CircleIcon } from './circle'; -export { AreaIcon } from './area'; -export { LineIcon } from './line'; -export { BarIcon } from './bar'; diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/line.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/line.tsx deleted file mode 100644 index 6735f58b734ec..0000000000000 --- a/src/plugins/chart_expressions/expression_xy/public/icons/line.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; - -export const LineIcon = ({ title, titleId, ...props }: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/mixed_xy.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/mixed_xy.tsx deleted file mode 100644 index e16b7f6bed76f..0000000000000 --- a/src/plugins/chart_expressions/expression_xy/public/icons/mixed_xy.tsx +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiIconProps } from '@elastic/eui'; - -export const MixedXyIcon = ({ title, titleId, ...props }: Omit) => ( - - {title ? {title} : null} - - - - -); diff --git a/src/plugins/charts/public/index.ts b/src/plugins/charts/public/index.ts index d6cae90d50057..8fd3fcf29f2cb 100644 --- a/src/plugins/charts/public/index.ts +++ b/src/plugins/charts/public/index.ts @@ -9,6 +9,7 @@ // TODO: https://github.com/elastic/kibana/issues/110891 /* eslint-disable @kbn/eslint/no_export_all */ +import { RangeSelectContext, ValueClickContext } from '@kbn/embeddable-plugin/public'; import { ChartsPlugin } from './plugin'; export const plugin = () => new ChartsPlugin(); @@ -19,6 +20,16 @@ export * from './static'; export { lightenColor } from './services/palettes/lighten_color'; export { useActiveCursor } from './services/active_cursor'; +export interface ClickTriggerEvent { + name: 'filter'; + data: ValueClickContext['data']; +} + +export interface BrushTriggerEvent { + name: 'brush'; + data: RangeSelectContext['data']; +} + export type { CustomPaletteArguments, CustomPaletteState, diff --git a/src/plugins/charts/public/static/index.ts b/src/plugins/charts/public/static/index.ts index 53078eebe9c56..031e90019d3c1 100644 --- a/src/plugins/charts/public/static/index.ts +++ b/src/plugins/charts/public/static/index.ts @@ -8,5 +8,4 @@ export * from './colors'; export * from './components'; -export * from './utils'; export * from '../../common/static/styles'; diff --git a/src/plugins/charts/public/static/utils/transform_click_event.ts b/src/plugins/charts/public/static/utils/transform_click_event.ts deleted file mode 100644 index ec35fa85d59a1..0000000000000 --- a/src/plugins/charts/public/static/utils/transform_click_event.ts +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { - XYChartSeriesIdentifier, - GeometryValue, - XYBrushEvent, - Accessor, - AccessorFn, - Datum, -} from '@elastic/charts'; - -import { RangeSelectContext, ValueClickContext } from '@kbn/embeddable-plugin/public'; -import { Datatable } from '@kbn/expressions-plugin/public'; - -export interface ClickTriggerEvent { - name: 'filter'; - data: ValueClickContext['data']; -} - -export interface BrushTriggerEvent { - name: 'brush'; - data: RangeSelectContext['data']; -} - -type AllSeriesAccessors = Array< - [accessor: Accessor | AccessorFn, value: string | number] ->; - -/** - * returns accessor value from string or function accessor - * @param datum - * @param accessor - */ -function getAccessorValue(datum: D, accessor: Accessor | AccessorFn) { - if (typeof accessor === 'function') { - return accessor(datum); - } - - return (datum as Datum)[accessor]; -} - -/** - * This is a little unorthodox, but using functional accessors makes it - * difficult to match the correct column. This creates a test object to throw - * an error when the target id is accessed, thus matcing the target column. - */ -function validateAccessorId(id: string, accessor: Accessor | AccessorFn) { - if (typeof accessor !== 'function') { - return id === accessor; - } - - const matchedMessage = 'validateAccessorId matched'; - - try { - accessor({ - get [id]() { - throw new Error(matchedMessage); - }, - }); - return false; - } catch ({ message }) { - return message === matchedMessage; - } -} - -/** - * Groups split accessors by their accessor string or function and related value - * - * @param splitAccessors - * @param splitSeriesAccessorFnMap - */ -const getAllSplitAccessors = ( - splitAccessors: Map, - splitSeriesAccessorFnMap?: Map -): Array<[accessor: Accessor | AccessorFn, value: string | number]> => - [...splitAccessors.entries()].map(([key, value]) => [ - splitSeriesAccessorFnMap?.get?.(key) ?? key, - value, - ]); - -/** - * Gets value from small multiple accessors - * - * Only handles single small multiple accessor - */ -function getSplitChartValue({ - smHorizontalAccessorValue, - smVerticalAccessorValue, -}: Pick): - | string - | number - | undefined { - if (smHorizontalAccessorValue !== undefined) { - return smHorizontalAccessorValue; - } - - if (smVerticalAccessorValue !== undefined) { - return smVerticalAccessorValue; - } - - return; -} - -/** - * Reduces matching column indexes - * - * @param xAccessor - * @param yAccessor - * @param splitAccessors - */ -const columnReducer = - ( - xAccessor: Accessor | AccessorFn | null, - yAccessor: Accessor | AccessorFn | null, - splitAccessors: AllSeriesAccessors, - splitChartAccessor?: Accessor | AccessorFn - ) => - ( - acc: Array<[index: number, id: string]>, - { id }: Datatable['columns'][number], - index: number - ): Array<[index: number, id: string]> => { - if ( - (xAccessor !== null && validateAccessorId(id, xAccessor)) || - (yAccessor !== null && validateAccessorId(id, yAccessor)) || - (splitChartAccessor !== undefined && validateAccessorId(id, splitChartAccessor)) || - splitAccessors.some(([accessor]) => validateAccessorId(id, accessor)) - ) { - acc.push([index, id]); - } - - return acc; - }; - -/** - * Finds matching row index for given accessors and geometry values - * - * @param geometry - * @param xAccessor - * @param yAccessor - * @param splitAccessors - */ -const rowFindPredicate = - ( - geometry: GeometryValue | null, - xAccessor: Accessor | AccessorFn | null, - yAccessor: Accessor | AccessorFn | null, - splitAccessors: AllSeriesAccessors, - splitChartAccessor?: Accessor | AccessorFn, - splitChartValue?: string | number - ) => - (row: Datatable['rows'][number]): boolean => - (geometry === null || - (xAccessor !== null && - getAccessorValue(row, xAccessor) === getAccessorValue(geometry.datum, xAccessor) && - yAccessor !== null && - getAccessorValue(row, yAccessor) === getAccessorValue(geometry.datum, yAccessor) && - (splitChartAccessor === undefined || - (splitChartValue !== undefined && - getAccessorValue(row, splitChartAccessor) === splitChartValue)))) && - [...splitAccessors].every(([accessor, value]) => getAccessorValue(row, accessor) === value); - -/** - * Helper function to transform `@elastic/charts` click event into filter action event - * - * @param table - * @param xAccessor - * @param splitSeriesAccessorFnMap needed when using `splitSeriesAccessors` as `AccessorFn` - * @param negate - */ -export const getFilterFromChartClickEventFn = - ( - table: Datatable, - xAccessor: Accessor | AccessorFn, - splitSeriesAccessorFnMap?: Map, - splitChartAccessor?: Accessor | AccessorFn, - negate: boolean = false - ) => - (points: Array<[GeometryValue, XYChartSeriesIdentifier]>): ClickTriggerEvent => { - const data: ValueClickContext['data']['data'] = []; - - points.forEach((point) => { - const [geometry, { yAccessor, splitAccessors }] = point; - const splitChartValue = getSplitChartValue(point[1]); - const allSplitAccessors = getAllSplitAccessors(splitAccessors, splitSeriesAccessorFnMap); - const columns = table.columns.reduce>( - columnReducer(xAccessor, yAccessor, allSplitAccessors, splitChartAccessor), - [] - ); - const row = table.rows.findIndex( - rowFindPredicate( - geometry, - xAccessor, - yAccessor, - allSplitAccessors, - splitChartAccessor, - splitChartValue - ) - ); - const newData = columns.map(([column, id]) => ({ - table, - column, - row, - value: table.rows?.[row]?.[id] ?? null, - })); - - data.push(...newData); - }); - - return { - name: 'filter', - data: { - negate, - data, - }, - }; - }; - -/** - * Helper function to get filter action event from series - */ -export const getFilterFromSeriesFn = - (table: Datatable) => - ( - { splitAccessors, ...rest }: XYChartSeriesIdentifier, - splitSeriesAccessorFnMap?: Map, - splitChartAccessor?: Accessor | AccessorFn, - negate = false - ): ClickTriggerEvent => { - const splitChartValue = getSplitChartValue(rest); - const allSplitAccessors = getAllSplitAccessors(splitAccessors, splitSeriesAccessorFnMap); - const columns = table.columns.reduce>( - columnReducer(null, null, allSplitAccessors, splitChartAccessor), - [] - ); - const row = table.rows.findIndex( - rowFindPredicate(null, null, null, allSplitAccessors, splitChartAccessor, splitChartValue) - ); - const data: ValueClickContext['data']['data'] = columns.map(([column, id]) => ({ - table, - column, - row, - value: table.rows?.[row]?.[id] ?? null, - })); - - return { - name: 'filter', - data: { - negate, - data, - }, - }; - }; - -/** - * Helper function to transform `@elastic/charts` brush event into brush action event - */ -export function getBrushFromChartBrushEventFn( - table: Datatable, - xAccessor: Accessor | AccessorFn -) { - return ({ x: selectedRange }: XYBrushEvent): BrushTriggerEvent => { - const [start, end] = selectedRange ?? [0, 0]; - const range: [number, number] = [start, end]; - const column = table.columns.findIndex(({ id }) => validateAccessorId(id, xAccessor)); - - return { - data: { - table, - column, - range, - }, - name: 'brush', - }; - }; -} diff --git a/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts b/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts index a696c8bc15b83..0c6aaba99b9ee 100644 --- a/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts +++ b/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { Storage } from '../../services/kibana_utils'; import { NotificationsStart } from '../../services/core'; import { panelStorageErrorStrings } from '../../dashboard_strings'; diff --git a/src/plugins/data/common/search/aggs/metrics/top_hit.test.ts b/src/plugins/data/common/search/aggs/metrics/top_hit.test.ts index 719687ea970bd..c25c6a70c994e 100644 --- a/src/plugins/data/common/search/aggs/metrics/top_hit.test.ts +++ b/src/plugins/data/common/search/aggs/metrics/top_hit.test.ts @@ -12,6 +12,7 @@ import { AggConfigs } from '../agg_configs'; import { mockAggTypesRegistry } from '../test_helpers'; import { IMetricAggConfig } from './metric_agg_type'; import { KBN_FIELD_TYPES } from '../../..'; +import * as tabifyModule from '../../tabify/tabify_docs'; describe('Top hit metric', () => { let aggDsl: Record; @@ -79,6 +80,11 @@ describe('Top hit metric', () => { aggDsl = aggConfig.toDsl(aggConfigs); }; + const flattenSpy = jest.spyOn(tabifyModule, 'flattenHit'); + beforeEach(() => { + jest.clearAllMocks(); + }); + it('should return a label prefixed with Last if sorting in descending order', () => { init({ fieldName: 'bytes' }); expect(getTopHitMetricAgg().makeLabel(aggConfig)).toEqual('Last bytes'); @@ -208,6 +214,7 @@ describe('Top hit metric', () => { init({ fieldName: '@tags' }); expect(getTopHitMetricAgg().getValue(aggConfig, bucket)).toBe('aaa'); + expect(flattenSpy).toHaveLastReturnedWith({ '@tags': 'aaa' }); }); it('should return the object if the field value is an object', () => { @@ -232,6 +239,7 @@ describe('Top hit metric', () => { expect(getTopHitMetricAgg().getValue(aggConfig, bucket)).toEqual({ label: 'aaa', }); + expect(flattenSpy).toHaveLastReturnedWith({ '@tags': { label: 'aaa' } }); }); it('should return an array if the field has more than one values', () => { @@ -251,6 +259,7 @@ describe('Top hit metric', () => { init({ fieldName: '@tags' }); expect(getTopHitMetricAgg().getValue(aggConfig, bucket)).toEqual(['aaa', 'bbb']); + expect(flattenSpy).toHaveLastReturnedWith({ '@tags': ['aaa', 'bbb'] }); }); it('should return undefined if the field is not in the source nor in the doc_values field', () => { diff --git a/src/plugins/data/common/search/aggs/metrics/top_hit.ts b/src/plugins/data/common/search/aggs/metrics/top_hit.ts index ce120f1271632..fee74bade2aa1 100644 --- a/src/plugins/data/common/search/aggs/metrics/top_hit.ts +++ b/src/plugins/data/common/search/aggs/metrics/top_hit.ts @@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n'; import { aggTopHitFnName } from './top_hit_fn'; import { IMetricAggConfig, MetricAggType } from './metric_agg_type'; import { METRIC_TYPES } from './metric_agg_types'; -import { KBN_FIELD_TYPES } from '../../..'; +import { flattenHit, KBN_FIELD_TYPES } from '../../..'; import { BaseAggParams } from '../types'; export interface AggParamsTopHit extends BaseAggParams { @@ -216,7 +216,7 @@ export const getTopHitMetricAgg = () => { let values = _.flatten( hits.map((hit) => - path === '_source' ? hit._source : agg.getIndexPattern().flattenHit(hit, true)[path] + path === '_source' ? hit._source : flattenHit(hit, agg.getIndexPattern())[path] ) ); 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 9f16795efa37a..5f4ce4be637a8 100644 --- a/src/plugins/data/common/search/search_source/search_source.ts +++ b/src/plugins/data/common/search/search_source/search_source.ts @@ -58,7 +58,7 @@ * `appSearchSource`. */ -import { setWith } from '@elastic/safer-lodash-set'; +import { setWith } from '@kbn/safer-lodash-set'; import { difference, isEqual, isFunction, isObject, keyBy, pick, uniqueId, uniqWith } from 'lodash'; import { catchError, diff --git a/src/plugins/data_view_editor/public/components/form_fields/title_field.tsx b/src/plugins/data_view_editor/public/components/form_fields/title_field.tsx index 6c41700ead531..822de9506500a 100644 --- a/src/plugins/data_view_editor/public/components/form_fields/title_field.tsx +++ b/src/plugins/data_view_editor/public/components/form_fields/title_field.tsx @@ -182,7 +182,6 @@ export const TitleField = ({ isInvalid={isInvalid} value={field.value} onChange={(e: ChangeEvent) => { - e.persist(); let query = e.target.value; if (query.length === 1 && !appendedWildcard && canAppendWildcard(query)) { query += '*'; diff --git a/src/plugins/discover/public/application/main/discover_main_route.test.tsx b/src/plugins/discover/public/application/main/discover_main_route.test.tsx index 6734864210ee6..aead62c038e47 100644 --- a/src/plugins/discover/public/application/main/discover_main_route.test.tsx +++ b/src/plugins/discover/public/application/main/discover_main_route.test.tsx @@ -22,7 +22,7 @@ import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_ import { findTestSubject } from '@elastic/eui/lib/test'; jest.mock('./discover_main_app', () => { return { - DiscoverMainApp: jest.fn(), + DiscoverMainApp: jest.fn().mockReturnValue(<>), }; }); diff --git a/src/plugins/embeddable/README.md b/src/plugins/embeddable/README.md index fc6632252bb01..14fab2f8412f3 100644 --- a/src/plugins/embeddable/README.md +++ b/src/plugins/embeddable/README.md @@ -4,6 +4,7 @@ The Embeddables Plugin provides an opportunity to expose reusable interactive wi ## Capabilities - Framework-agnostic API. - Out-of-the-box React support. +- Integration with Redux. - Integration with the [UI Actions](https://github.com/elastic/kibana/tree/HEAD/src/plugins/ui_actions) plugin. - Hierarchical structure to enclose multiple widgets. - Error handling. @@ -354,6 +355,251 @@ The plugin provides a set of ready-to-use React components that abstract renderi Apart from the React components, there is also a way to construct an embeddable object using `useEmbeddableFactory` hook. This React hook takes care of producing an embeddable and updating its input state if passed state changes. +### Redux +The plugin provides an adapter for Redux over the embeddable state. +It uses the Redux Toolkit library underneath and works as a decorator on top of the [`configureStore`](https://redux-toolkit.js.org/api/configureStore) function. +In other words, it provides a way to use the full power of the library together with the embeddable plugin features. + +The adapter implements a bi-directional sync mechanism between the embeddable instance and the Redux state. +To perform state mutations, the plugin also exposes a pre-defined state of the actions that can be extended by an additional reducer. + +Here is an example of initializing a Redux store: +```tsx +import React from 'react'; +import { render } from 'react-dom'; +import { connect, Provider } from 'react-redux'; +import { Embeddable, IEmbeddable } from '@kbn/embeddable-plugin/public'; +import { createStore, State } from '@kbn/embeddable-plugin/public/store'; +import { HelloWorldComponent } from './hello_world_component'; + +export const HELLO_WORLD = 'HELLO_WORLD'; + +export class HelloWorld extends Embeddable { + readonly type = HELLO_WORLD; + + readonly store = createStore(this); + + reload() {} + + render(node: HTMLElement) { + const Component = connect((state: State) => ({ title: state.input.title }))( + HelloWorldComponent + ); + + render( + + + , + node + ); + } +} +``` + +Then inside the embedded component, it is possible to use the [`useSelector`](https://react-redux.js.org/api/hooks#useselector) and [`useDispatch`](https://react-redux.js.org/api/hooks#usedispatch) hooks. +```tsx +import React from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { actions, State } from '@kbn/embeddable-plugin/public/store'; +import { ViewMode } from '@kbn/embeddable-plugin/public'; +import type { HelloWorld } from './hello_world'; + +interface HelloWorldComponentProps { + title?: string; +} + +export function HelloWorldComponent({ title }: HelloWorldComponentProps) { + const viewMode = useSelector>(({ input }) => input.viewMode); + const dispatch = useDispatch(); + + return ( +
+

{title}

+ {viewMode === ViewMode.EDIT && ( + dispatch(actions.input.setTitle(target.value))} + /> + )} +
+ ); +} +``` + +#### Custom Properties +The `createStore` function provides an option to pass a custom reducer in the second argument. +That reducer will be merged with the one the embeddable plugin provides. +That means there is no need to reimplement already existing actions. + +```tsx +import React from 'react'; +import { render } from 'react-dom'; +import { createSlice } from '@reduxjs/toolkit'; +import { + Embeddable, + EmbeddableInput, + EmbeddableOutput, + IEmbeddable +} from '@kbn/embeddable-plugin/public'; +import { createStore, State } from '@kbn/embeddable-plugin/public/store'; + +interface HelloWorldInput extends EmbeddableInput { + greeting?: string; +} + +interface HelloWorldOutput extends EmbeddableOutput { + message?: string; +} + +const input = createSlice({ + name: 'hello-world-input', + initialState: {} as HelloWorldInput, + reducers: { + setGreeting(state, action: PayloadAction) { + state.greeting = action.payload; + }, + }, +}); + +const output = createSlice({ + name: 'hello-world-input', + initialState: {} as HelloWorldOutput, + reducers: { + setMessage(state, action: PayloadAction) { + state.message = action.payload; + }, + }, +}); + +export const actions = { + ...input.actions, + ...output.actions, +}; + +export class HelloWorld extends Embeddable { + readonly store = createStore(this, { + reducer: { + input: input.reducer, + output: output.reducer, + } + }); + + // ... +} +``` + +There is a way to provide a custom reducer that will manipulate the root state: +```typescript +// ... + +import { createAction, createRducer } from '@reduxjs/toolkit'; + +// ... + +const setGreeting = createAction('greeting'); +const setMessage = createAction('message'); +const reducer = createReducer({} as State, (builder) => + builder + .addCase(setGreeting, (state, action) => ({ ...state, input: { ...state.input, greeting: action.payload } })) + .addCase(setMessage, (state, action) => ({ ...state, output: { ...state.output, message: action.payload } })) +); + +export const actions = { + setGreeting, + setMessage, +}; + +export class HelloWorld extends Embeddable { + readonly store = createStore(this, { reducer }); + + // ... +} +``` + +#### Custom State +Sometimes, there is a need to store a custom state next to the embeddable state. +This can be achieved by passing a custom reducer. + +```tsx +import React from 'react'; +import { render } from 'react-dom'; +import { createSlice } from '@reduxjs/toolkit'; +import { Embeddable, IEmbeddable } from '@kbn/embeddable-plugin/public'; +import { createStore, State } from '@kbn/embeddable-plugin/public/store'; + +interface ComponentState { + foo?: string; + bar?: string; +} + +export interface HelloWorldState extends State { + component: ComponentState; +} + +const component = createSlice({ + name: 'hello-world-component', + initialState: {} as ComponentState, + reducers: { + setFoo(state, action: PayloadAction) { + state.foo = action.payload; + }, + setBar(state, action: PayloadAction) { + state.bar = action.payload; + }, + }, +}); + +export const { actions } = component; + +export class HelloWorld extends Embeddable { + readonly store = createStore(this, { + preloadedState: { + component: { + foo: 'bar', + bar: 'foo', + } + }, + reducer: { component: component.reducer } + }); + + // ... +} +``` + +#### Typings +When using the `useSelector` hook, it is convenient to have a `State` type to guarantee type safety and determine types implicitly. + +For the state containing input and output substates only, it is enough to use a utility type `State`: +```typescript +import { useSelector } from 'react-redux'; +import type { State } from '@kbn/embeddable-plugin/public/store'; +import type { Embeddable } from './some_embeddable'; + +// ... +const title = useSelector>((state) => state.input.title); +``` + +For the more complex case, the best way would be to define a state type separately: +```typescript +import { useSelector } from 'react-redux'; +import type { State } from '@kbn/embeddable-plugin/public/store'; +import type { Embeddable } from './some_embeddable'; + +interface EmbeddableState extends State { + foo?: string; + bar?: Bar; +} + +// ... +const foo = useSelector((state) => state.foo); +``` + +#### Advanced Usage +In case when there is a need to enhance the produced store in some way (e.g., perform custom serialization or debugging), it is possible to use [parameters](https://redux-toolkit.js.org/api/configureStore#parameters) supported by the `configureStore` function. + +In case when custom serialization is needed, that should be done using middleware. The embeddable plugin's `createStore` function does not apply any middleware, so all the synchronization job is done outside the store. + ## API Please use automatically generated API reference or generated TypeDoc comments to find the complete documentation. diff --git a/src/plugins/embeddable/public/__stories__/embeddable_panel.stories.tsx b/src/plugins/embeddable/public/__stories__/embeddable_panel.stories.tsx index 1f15b942fb589..97e8b83b9f7b1 100644 --- a/src/plugins/embeddable/public/__stories__/embeddable_panel.stories.tsx +++ b/src/plugins/embeddable/public/__stories__/embeddable_panel.stories.tsx @@ -25,6 +25,7 @@ import { CoreTheme } from '@kbn/core-theme-browser'; import type { Action } from '@kbn/ui-actions-plugin/public'; import { CONTEXT_MENU_TRIGGER, EmbeddablePanel, PANEL_BADGE_TRIGGER, ViewMode } from '..'; +import { actions } from '../store'; import { HelloWorldEmbeddable } from './hello_world_embeddable'; const layout: DecoratorFn = (story) => { @@ -93,20 +94,16 @@ const HelloWorldEmbeddablePanel = forwardRef< const theme = useContext(ThemeContext) as CoreTheme; useEffect(() => theme$.next(theme), [theme$, theme]); + useEffect(() => { + embeddable.store.dispatch(actions.input.setTitle(title)); + }, [embeddable.store, title]); + useEffect(() => { + embeddable.store.dispatch( + actions.input.setViewMode(viewMode ? ViewMode.VIEW : ViewMode.EDIT) + ); + }, [embeddable.store, viewMode]); useEffect( - () => - embeddable.updateInput({ - title, - viewMode: viewMode ? ViewMode.VIEW : ViewMode.EDIT, - lastReloadRequestTime: new Date().getMilliseconds(), - }), - [embeddable, title, viewMode] - ); - useEffect( - () => - embeddable.updateOutput({ - loading, - }), + () => void embeddable.store.dispatch(actions.output.setLoading(loading)), [embeddable, loading] ); useImperativeHandle(ref, () => ({ embeddable })); @@ -162,7 +159,9 @@ export function DefaultWithBadges({ badges, ...props }: DefaultWithBadgesProps) useEffect( () => - ref.current?.embeddable.updateInput({ lastReloadRequestTime: new Date().getMilliseconds() }), + void ref.current?.embeddable.store.dispatch( + actions.input.setLastReloadRequestTime(new Date().getMilliseconds()) + ), [getActions] ); @@ -207,7 +206,9 @@ export function DefaultWithContextMenu({ items, ...props }: DefaultWithContextMe useEffect( () => - ref.current?.embeddable.updateInput({ lastReloadRequestTime: new Date().getMilliseconds() }), + void ref.current?.embeddable.store.dispatch( + actions.input.setLastReloadRequestTime(new Date().getMilliseconds()) + ), [getActions] ); @@ -230,7 +231,10 @@ interface DefaultWithErrorProps extends HelloWorldEmbeddablePanelProps { export function DefaultWithError({ message, ...props }: DefaultWithErrorProps) { const ref = useRef>(null); - useEffect(() => ref.current?.embeddable.updateOutput({ error: new Error(message) }), [message]); + useEffect( + () => void ref.current?.embeddable.store.dispatch(actions.output.setError(new Error(message))), + [message] + ); return ; } @@ -256,7 +260,10 @@ export function DefaultWithCustomError({ message, ...props }: DefaultWithErrorPr }), [] ); - useEffect(() => ref.current?.embeddable.updateOutput({ error: new Error(message) }), [message]); + useEffect( + () => void ref.current?.embeddable.store.dispatch(actions.output.setError(new Error(message))), + [message] + ); return ; } diff --git a/src/plugins/embeddable/public/__stories__/hello_world_embeddable.tsx b/src/plugins/embeddable/public/__stories__/hello_world_embeddable.tsx index 2ea923704be77..5cf2c5fdc46e8 100644 --- a/src/plugins/embeddable/public/__stories__/hello_world_embeddable.tsx +++ b/src/plugins/embeddable/public/__stories__/hello_world_embeddable.tsx @@ -8,10 +8,15 @@ import React from 'react'; import { render } from 'react-dom'; +import { connect, Provider } from 'react-redux'; import { EuiEmptyPrompt } from '@elastic/eui'; import { Embeddable, IEmbeddable } from '..'; +import { createStore, State } from '../store'; export class HelloWorldEmbeddable extends Embeddable { + // eslint-disable-next-line @kbn/eslint/no_this_in_property_initializers + readonly store = createStore(this); + readonly type = 'hello-world'; renderError: IEmbeddable['renderError']; @@ -19,16 +24,17 @@ export class HelloWorldEmbeddable extends Embeddable { reload() {} render(node: HTMLElement) { - render(, node); - - this.reload = this.render.bind(this, node); + const App = connect((state: State) => ({ body: state.input.title }))(EuiEmptyPrompt); + + render( + + + , + node + ); } setErrorRenderer(renderer: IEmbeddable['renderError']) { this.renderError = renderer; } - - updateOutput(...args: Parameters): void { - return super.updateOutput(...args); - } } diff --git a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx b/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx index cb93ef13b918d..17a41e841abff 100644 --- a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx +++ b/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx @@ -45,7 +45,7 @@ export interface AttributeServiceOptions< attributes: SavedObjectAttributes, savedObjectId?: string ) => Promise<{ id?: string } | { error: Error }>; - checkForDuplicateTitle: (props: OnSaveProps) => Promise; + checkForDuplicateTitle: (props: OnSaveProps) => Promise; unwrapMethod?: ( savedObjectId: string ) => Promise>; diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx index 001cb98afa6c1..94025320ec86d 100644 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx +++ b/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx @@ -41,8 +41,10 @@ export abstract class Embeddable< protected output: TEmbeddableOutput; protected input: TEmbeddableInput; - private readonly input$: Rx.BehaviorSubject; - private readonly output$: Rx.BehaviorSubject; + private readonly inputSubject = new Rx.ReplaySubject(1); + private readonly outputSubject = new Rx.ReplaySubject(1); + private readonly input$ = this.inputSubject.asObservable(); + private readonly output$ = this.outputSubject.asObservable(); protected renderComplete = new RenderCompleteDispatcher(); @@ -71,8 +73,8 @@ export abstract class Embeddable< }; this.parent = parent; - this.input$ = new Rx.BehaviorSubject(this.input); - this.output$ = new Rx.BehaviorSubject(this.output); + this.inputSubject.next(this.input); + this.outputSubject.next(this.output); if (parent) { this.parentSubscription = Rx.merge(parent.getInput$(), parent.getOutput$()).subscribe(() => { @@ -89,12 +91,7 @@ export abstract class Embeddable< map(({ title }) => title || ''), distinctUntilChanged() ) - .subscribe( - (title) => { - this.renderComplete.setTitle(title); - }, - () => {} - ); + .subscribe((title) => this.renderComplete.setTitle(title)); } public reportsEmbeddableLoad() { @@ -142,11 +139,11 @@ export abstract class Embeddable< } public getInput$(): Readonly> { - return this.input$.asObservable(); + return this.input$; } public getOutput$(): Readonly> { - return this.output$.asObservable(); + return this.output$; } public getOutput(): Readonly { @@ -238,8 +235,8 @@ export abstract class Embeddable< public destroy(): void { this.destroyed = true; - this.input$.complete(); - this.output$.complete(); + this.inputSubject.complete(); + this.outputSubject.complete(); if (this.parentSubscription) { this.parentSubscription.unsubscribe(); @@ -257,20 +254,20 @@ export abstract class Embeddable< } } - protected updateOutput(outputChanges: Partial): void { + public updateOutput(outputChanges: Partial): void { const newOutput = { ...this.output, ...outputChanges, }; if (!fastIsEqual(this.output, newOutput)) { this.output = newOutput; - this.output$.next(this.output); + this.outputSubject.next(this.output); } } protected onFatalError(e: Error) { this.fatalError = e; - this.output$.error(e); + this.outputSubject.error(e); // if the container is waiting for this embeddable to complete loading, // a fatal error counts as complete. if (this.deferEmbeddableLoad && this.parent?.isContainer) { @@ -282,7 +279,7 @@ export abstract class Embeddable< if (!fastIsEqual(this.input, newInput)) { const oldLastReloadRequestTime = this.input.lastReloadRequestTime; this.input = newInput; - this.input$.next(newInput); + this.inputSubject.next(newInput); this.updateOutput({ title: getPanelTitle(this.input, this.output), } as Partial); diff --git a/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts b/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts index 9037de1a10075..1c9bdebcefc9b 100644 --- a/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts +++ b/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts @@ -142,6 +142,12 @@ export interface IEmbeddable< */ updateInput(changes: Partial): void; + /** + * Updates output state with the given changes. + * @param changes + */ + updateOutput(changes: Partial): void; + /** * Returns an observable which will be notified when input state changes. */ diff --git a/src/plugins/embeddable/public/store/create_store.test.ts b/src/plugins/embeddable/public/store/create_store.test.ts new file mode 100644 index 0000000000000..52ac1eb32c8dc --- /dev/null +++ b/src/plugins/embeddable/public/store/create_store.test.ts @@ -0,0 +1,245 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +// eslint-disable-next-line max-classes-per-file +import { createAction, createReducer, createSlice, PayloadAction } from '@reduxjs/toolkit'; +import type { Store } from 'redux'; +import { + defaultEmbeddableFactoryProvider, + Container, + ContainerInput, + Embeddable, + EmbeddableInput, + EmbeddableOutput, +} from '../lib'; +import { createStore, State } from './create_store'; +import { input } from './input_slice'; +import { output } from './output_slice'; + +interface TestEmbeddableInput extends EmbeddableInput { + custom?: string; +} + +interface TestEmbeddableOutput extends EmbeddableOutput { + custom?: string; +} + +interface TestContainerInput extends ContainerInput { + custom?: string; +} + +class TestEmbeddable extends Embeddable { + type = 'test'; + reload = jest.fn(); + render = jest.fn(); +} + +class TestContainer extends Container, TestContainerInput> { + type = 'test'; + + getInheritedInput() { + return { + custom: this.input.custom, + }; + } +} + +describe('createStore', () => { + let embeddable: TestEmbeddable; + let store: Store>; + + beforeEach(() => { + embeddable = new TestEmbeddable({ id: '12345' }, { title: 'Test' }); + store = createStore(embeddable); + }); + + it('should populate the state with the embeddable input', () => { + expect(store.getState()).toHaveProperty('input', expect.objectContaining({ id: '12345' })); + }); + + it('should populate the state with the embeddable output', () => { + expect(store.getState()).toHaveProperty('output', expect.objectContaining({ title: 'Test' })); + }); + + it('should update the embeddable input on action dispatch', () => { + store.dispatch(input.actions.setTitle('Something')); + + expect(store.getState()).toHaveProperty('input.title', 'Something'); + }); + + it('should update the embeddable output on action dispatch', () => { + store.dispatch(output.actions.setTitle('Something')); + + expect(store.getState()).toHaveProperty('output.title', 'Something'); + }); + + it('should group input updates on multiple dispatch calls', async () => { + jest.spyOn(embeddable, 'updateInput'); + store.dispatch(input.actions.setTitle('Something')); + store.dispatch(input.actions.setHidePanelTitles(true)); + await new Promise((resolve) => setTimeout(resolve)); + + expect(embeddable.updateInput).toHaveBeenCalledTimes(1); + expect(embeddable.updateInput).nthCalledWith( + 1, + expect.objectContaining({ title: 'Something', hidePanelTitles: true }) + ); + }); + + it('should group output updates on multiple dispatch calls', async () => { + jest.spyOn(embeddable, 'updateOutput'); + store.dispatch(output.actions.setTitle('Something')); + store.dispatch(output.actions.setLoading(true)); + await new Promise((resolve) => setTimeout(resolve)); + + expect(embeddable.updateOutput).toHaveBeenCalledTimes(1); + expect(embeddable.updateOutput).nthCalledWith( + 1, + expect.objectContaining({ title: 'Something', loading: true }) + ); + }); + + it('should not update input on output changes', async () => { + jest.spyOn(embeddable, 'updateInput'); + store.dispatch(output.actions.setTitle('Something')); + await new Promise((resolve) => setTimeout(resolve)); + + expect(embeddable.updateInput).not.toHaveBeenCalled(); + }); + + it('should sync input changes', () => { + jest.spyOn(embeddable, 'updateInput'); + embeddable.updateInput({ title: 'Something' }); + + expect(embeddable.updateInput).toHaveBeenCalledTimes(1); + expect(store.getState()).toHaveProperty('input.title', 'Something'); + }); + + it('should sync output changes', () => { + jest.spyOn(embeddable, 'updateOutput'); + embeddable.updateOutput({ title: 'Something' }); + + expect(embeddable.updateOutput).toHaveBeenCalledTimes(1); + expect(store.getState()).toHaveProperty('output.title', 'Something'); + }); + + it('should provide a way to use a custom reducer', async () => { + const setCustom = createAction('custom'); + const customStore = createStore(embeddable, { + reducer: { + input: createReducer({} as TestEmbeddableInput, (builder) => + builder.addCase(setCustom, (state, action) => ({ ...state, custom: action.payload })) + ), + }, + }); + + jest.spyOn(embeddable, 'updateInput'); + customStore.dispatch(input.actions.setTitle('Something')); + customStore.dispatch(setCustom('Something else')); + await new Promise((resolve) => setTimeout(resolve)); + + expect(embeddable.updateInput).toHaveBeenCalledWith( + expect.objectContaining({ custom: 'Something else', title: 'Something' }) + ); + }); + + it('should provide a way to use a custom slice', async () => { + const slice = createSlice({ + name: 'test', + initialState: {} as State, + reducers: { + setCustom(state, action: PayloadAction) { + state.input.custom = action.payload; + state.output.custom = action.payload; + }, + }, + }); + const customStore = createStore(embeddable, { reducer: slice.reducer }); + + jest.spyOn(embeddable, 'updateInput'); + jest.spyOn(embeddable, 'updateOutput'); + customStore.dispatch(input.actions.setTitle('Something')); + customStore.dispatch(slice.actions.setCustom('Something else')); + await new Promise((resolve) => setTimeout(resolve)); + + expect(embeddable.updateInput).toHaveBeenCalledWith( + expect.objectContaining({ custom: 'Something else', title: 'Something' }) + ); + expect(embeddable.updateOutput).toHaveBeenCalledWith( + expect.objectContaining({ custom: 'Something else' }) + ); + }); + + describe('of a nested embeddable', () => { + const factory = defaultEmbeddableFactoryProvider< + TestEmbeddableInput, + TestEmbeddableOutput, + TestEmbeddable + >({ + type: 'test', + getDisplayName: () => 'Test', + isEditable: async () => true, + create: async (data, parent) => new TestEmbeddable(data, {}, parent), + }); + const getFactory = jest.fn().mockReturnValue(factory); + + let container: TestContainer; + + beforeEach(async () => { + container = new TestContainer( + { custom: 'something', id: 'id', panels: {} }, + { embeddableLoaded: {} }, + getFactory + ); + embeddable = (await container.addNewEmbeddable('test', { id: '12345' })) as TestEmbeddable; + store = createStore(embeddable); + }); + + it('should populate inherited input', () => { + expect(store.getState()).toHaveProperty('input.custom', 'something'); + }); + + it('should override inherited input on dispatch', async () => { + store.dispatch( + input.actions.update({ custom: 'something else' } as Partial) + ); + await new Promise((resolve) => setTimeout(resolve)); + + expect(store.getState()).toHaveProperty('input.custom', 'something else'); + expect(container.getInput()).toHaveProperty( + 'input.custom', + expect.not.stringMatching('something else') + ); + }); + + it('should restore value from the inherited input', async () => { + store.dispatch( + input.actions.update({ custom: 'something else' } as Partial) + ); + await new Promise((resolve) => setTimeout(resolve)); + store.dispatch(input.actions.update({ custom: undefined } as Partial)); + await new Promise((resolve) => setTimeout(resolve)); + + expect(store.getState()).toHaveProperty('input.custom', 'something'); + }); + + it('should not override inherited input on dispatch', async () => { + store.dispatch(input.actions.setTitle('Something')); + await new Promise((resolve) => setTimeout(resolve)); + container.updateInput({ custom: 'something else' }); + + expect(store.getState()).toHaveProperty( + 'input', + expect.objectContaining({ + title: 'Something', + custom: 'something else', + }) + ); + }); + }); +}); diff --git a/src/plugins/embeddable/public/store/create_store.ts b/src/plugins/embeddable/public/store/create_store.ts new file mode 100644 index 0000000000000..135f793c079dd --- /dev/null +++ b/src/plugins/embeddable/public/store/create_store.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { chain, isEmpty, keys } from 'lodash'; +import { combineReducers, Reducer, Store, ReducersMapObject } from 'redux'; +import { configureStore, ConfigureStoreOptions } from '@reduxjs/toolkit'; +import { + debounceTime, + distinctUntilChanged, + filter, + last, + map, + pluck, + share, + takeUntil, + Observable, +} from 'rxjs'; +import reduceReducers from 'reduce-reducers'; +import type { Optional } from 'utility-types'; +import type { IEmbeddable } from '../lib'; +import { input } from './input_slice'; +import { output } from './output_slice'; + +export interface State { + input: E extends IEmbeddable ? I : never; + output: E extends IEmbeddable ? O : never; +} + +export interface CreateStoreOptions + extends Omit, 'reducer'> { + reducer?: Reducer | Optional, keyof State>; +} + +function createReducer( + reducer?: CreateStoreOptions['reducer'] +): Reducer | ReducersMapObject { + if (reducer instanceof Function) { + const generic = combineReducers>({ + input: input.reducer, + output: output.reducer, + }) as Reducer; + + return reduceReducers(generic, reducer) as Reducer; + } + + return { + ...(reducer ?? {}), + input: reducer?.input ? reduceReducers(input.reducer, reducer.input) : input.reducer, + output: reducer?.output ? reduceReducers(output.reducer, reducer.output) : output.reducer, + } as ReducersMapObject; +} + +function diff>(previous: T, current: T) { + return chain(current) + .keys() + .concat(keys(previous)) + .uniq() + .filter((key) => previous[key] !== current[key]) + .map((key) => [key, current[key]]) + .fromPairs() + .value() as Partial; +} + +/** + * Creates a Redux store for the given embeddable. + * @param embeddable The embeddable instance. + * @param options The custom options to pass to the `configureStore` call. + * @returns The Redux store. + */ +export function createStore = State>( + embeddable: E, + { preloadedState, reducer, ...options }: CreateStoreOptions = {} +): Store { + const store = configureStore({ + ...options, + preloadedState: { + input: embeddable.getInput(), + output: embeddable.getOutput(), + ...(preloadedState ?? {}), + } as NonNullable, + reducer: createReducer(reducer), + }); + + const state$ = new Observable((subscriber) => { + subscriber.add(store.subscribe(() => subscriber.next(store.getState()))); + }).pipe(share()); + const input$ = embeddable.getInput$(); + const output$ = embeddable.getOutput$(); + + state$ + .pipe( + takeUntil(input$.pipe(last())), + pluck('input'), + distinctUntilChanged(), + map((value) => diff(embeddable.getInput(), value)), + filter((patch) => !isEmpty(patch)), + debounceTime(0) + ) + .subscribe((patch) => embeddable.updateInput(patch)); + + state$ + .pipe( + takeUntil(output$.pipe(last())), + pluck('output'), + distinctUntilChanged(), + map((value) => diff(embeddable.getOutput(), value)), + filter((patch) => !isEmpty(patch)), + debounceTime(0) + ) + .subscribe((patch) => embeddable.updateOutput(patch)); + + input$ + .pipe( + map((value) => diff(store.getState().input, value)), + filter((patch) => !isEmpty(patch)) + ) + .subscribe((patch) => store.dispatch(input.actions.update(patch))); + + output$ + .pipe( + map((value) => diff(store.getState().output, value)), + filter((patch) => !isEmpty(patch)) + ) + .subscribe((patch) => store.dispatch(output.actions.update(patch))); + + return store; +} diff --git a/packages/shared-ux/button/exit_full_screen/mocks/jest.config.js b/src/plugins/embeddable/public/store/index.ts similarity index 57% rename from packages/shared-ux/button/exit_full_screen/mocks/jest.config.js rename to src/plugins/embeddable/public/store/index.ts index 3485a061a38ee..05567e0215589 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/jest.config.js +++ b/src/plugins/embeddable/public/store/index.ts @@ -6,8 +6,12 @@ * Side Public License, v 1. */ -module.exports = { - preset: '@kbn/test/jest_node', - rootDir: '../../../../..', - roots: ['/packages/shared-ux/button/exit_full_screen/mocks'], +import { input } from './input_slice'; +import { output } from './output_slice'; + +export type { CreateStoreOptions, State } from './create_store'; +export { createStore } from './create_store'; +export const actions = { + input: input.actions, + output: output.actions, }; diff --git a/src/plugins/embeddable/public/store/input_slice.ts b/src/plugins/embeddable/public/store/input_slice.ts new file mode 100644 index 0000000000000..da4bc6618ae11 --- /dev/null +++ b/src/plugins/embeddable/public/store/input_slice.ts @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createSlice, PayloadAction } from '@reduxjs/toolkit'; +import type { EmbeddableInput } from '../lib'; + +export const input = createSlice({ + name: 'input', + initialState: {} as EmbeddableInput, + reducers: { + setDisabledActions(state, action: PayloadAction) { + state.disabledActions = action.payload; + }, + setDisableTriggers(state, action: PayloadAction) { + state.disableTriggers = action.payload; + }, + setEnhancements(state, action: PayloadAction) { + state.enhancements = action.payload; + }, + setExecutionContext(state, action: PayloadAction) { + state.executionContext = action.payload; + }, + setHidePanelTitles(state, action: PayloadAction) { + state.hidePanelTitles = action.payload; + }, + setLastReloadRequestTime( + state, + action: PayloadAction + ) { + state.lastReloadRequestTime = action.payload; + }, + setSearchSessionId(state, action: PayloadAction) { + state.searchSessionId = action.payload; + }, + setSyncColors(state, action: PayloadAction) { + state.syncColors = action.payload; + }, + setSyncTooltips(state, action: PayloadAction) { + state.syncTooltips = action.payload; + }, + setTitle(state, action: PayloadAction) { + state.title = action.payload; + }, + setViewMode(state, action: PayloadAction) { + state.viewMode = action.payload; + }, + update(state, action: PayloadAction>) { + return { ...state, ...action.payload }; + }, + }, +}); diff --git a/src/plugins/embeddable/public/store/output_slice.ts b/src/plugins/embeddable/public/store/output_slice.ts new file mode 100644 index 0000000000000..c3cbaf6875893 --- /dev/null +++ b/src/plugins/embeddable/public/store/output_slice.ts @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createSlice, PayloadAction } from '@reduxjs/toolkit'; +import type { EmbeddableOutput } from '../lib'; + +export const output = createSlice({ + name: 'output', + initialState: {} as EmbeddableOutput, + reducers: { + setLoading(state, action: PayloadAction) { + state.loading = action.payload; + }, + setRendered(state, action: PayloadAction) { + state.rendered = action.payload; + }, + setError(state, action: PayloadAction) { + state.error = action.payload; + }, + setEditUrl(state, action: PayloadAction) { + state.editUrl = action.payload; + }, + setEditApp(state, action: PayloadAction) { + state.editApp = action.payload; + }, + setEditPath(state, action: PayloadAction) { + state.editPath = action.payload; + }, + setDefaultTitle(state, action: PayloadAction) { + state.defaultTitle = action.payload; + }, + setTitle(state, action: PayloadAction) { + state.title = action.payload; + }, + setEditable(state, action: PayloadAction) { + state.editable = action.payload; + }, + setSavedObjectId(state, action: PayloadAction) { + state.savedObjectId = action.payload; + }, + update(state, action: PayloadAction>) { + return { ...state, ...action.payload }; + }, + }, +}); diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form.ts b/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form.ts index b6b45c76e7115..95ed985bf1a2f 100644 --- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form.ts +++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form.ts @@ -8,7 +8,7 @@ import { useState, useRef, useEffect, useMemo, useCallback } from 'react'; import { get, mergeWith } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { FormHook, FieldHook, FormData, FieldsMap, FormConfig } from '../types'; import { diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/lib/utils.ts b/src/plugins/es_ui_shared/static/forms/hook_form_lib/lib/utils.ts index 54f6726abb115..fe41de2947795 100644 --- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/lib/utils.ts +++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/lib/utils.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { FieldHook } from '../types'; interface GenericObject { diff --git a/src/plugins/home/public/application/components/guided_onboarding/getting_started.tsx b/src/plugins/home/public/application/components/guided_onboarding/getting_started.tsx index b5415064eea17..9f27a0194a3ca 100644 --- a/src/plugins/home/public/application/components/guided_onboarding/getting_started.tsx +++ b/src/plugins/home/public/application/components/guided_onboarding/getting_started.tsx @@ -21,7 +21,7 @@ import { import { css } from '@emotion/react'; import { METRIC_TYPE } from '@kbn/analytics'; import { i18n } from '@kbn/i18n'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { getServices } from '../../kibana_services'; import { KEY_ENABLE_WELCOME } from '../home'; diff --git a/src/plugins/interactive_setup/public/use_form.ts b/src/plugins/interactive_setup/public/use_form.ts index abd00edee6750..47768400dd775 100644 --- a/src/plugins/interactive_setup/public/use_form.ts +++ b/src/plugins/interactive_setup/public/use_form.ts @@ -6,12 +6,13 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; import { cloneDeep, cloneDeepWith, get } from 'lodash'; import type { ChangeEventHandler, FocusEventHandler, ReactEventHandler } from 'react'; import { useState } from 'react'; import useAsyncFn from 'react-use/lib/useAsyncFn'; +import { set } from '@kbn/safer-lodash-set'; + export type FormReturnTuple = [FormState, FormProps]; export interface FormProps { diff --git a/src/plugins/kibana_overview/public/components/overview/overview.test.tsx b/src/plugins/kibana_overview/public/components/overview/overview.test.tsx index 99d8b45cdf27b..0fbedc5c3367e 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.test.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.test.tsx @@ -13,16 +13,16 @@ import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; import { EuiLoadingSpinner } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import type { FeatureCatalogueCategory } from '@kbn/home-plugin/public'; import { AnalyticsNoDataPageKibanaProvider } from '@kbn/shared-ux-page-analytics-no-data'; import { hasESData, hasUserDataView } from './overview.test.mocks'; import { Overview } from './overview'; -jest.mock('@kbn/shared-ux-components', () => { +jest.mock('@kbn/shared-ux-page-kibana-template', () => { const MockedComponent: string = 'MockedKibanaPageTemplate'; const mockedModule = { - ...jest.requireActual('@kbn/shared-ux-components'), + ...jest.requireActual('@kbn/shared-ux-page-kibana-template'), KibanaPageTemplate: () => { return ; }, diff --git a/src/plugins/kibana_overview/public/components/overview/overview.tsx b/src/plugins/kibana_overview/public/components/overview/overview.tsx index 738b278b17b36..245fcb12c7afd 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.tsx @@ -25,7 +25,7 @@ import { overviewPageActions, OverviewPageFooter, } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { KibanaSolutionAvatar } from '@kbn/shared-ux-avatar-solution'; import { AnalyticsNoDataPageKibanaProvider, diff --git a/src/plugins/kibana_react/public/app_links/index.ts b/src/plugins/kibana_react/public/app_links/index.ts index ca09b2a3bfe36..3bfd7baca0c02 100644 --- a/src/plugins/kibana_react/public/app_links/index.ts +++ b/src/plugins/kibana_react/public/app_links/index.ts @@ -5,5 +5,5 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-components */ +/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-link-redirect-app` */ export { RedirectAppLinks } from './redirect_app_link'; diff --git a/src/plugins/kibana_react/public/app_links/redirect_app_link.test.tsx b/src/plugins/kibana_react/public/app_links/redirect_app_link.test.tsx index 133cab06e6b6f..f4ce0d3ff80d3 100644 --- a/src/plugins/kibana_react/public/app_links/redirect_app_link.test.tsx +++ b/src/plugins/kibana_react/public/app_links/redirect_app_link.test.tsx @@ -9,7 +9,7 @@ import React, { MouseEvent } from 'react'; import { mount } from 'enzyme'; import { applicationServiceMock } from '@kbn/core/public/mocks'; -/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-components */ +/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-link-redirect-app` */ import { RedirectAppLinks } from './redirect_app_link'; import { BehaviorSubject } from 'rxjs'; diff --git a/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx b/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx index 339055c3e1da5..6df1c43dbc5c6 100644 --- a/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx +++ b/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx @@ -35,7 +35,7 @@ interface RedirectCrossAppLinksProps extends React.HTMLAttributes = ({ 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 9a4511f8b03f5..6d077e6e174e5 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 @@ -226,21 +226,6 @@ exports[` is rendered 1`] = `
- - -
- -
`; diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx index b66d136c50710..97a8d8a849083 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx @@ -43,7 +43,15 @@ const logs = ` [Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome `; +class ResizeObserver { + observe() {} + unobserve() {} + disconnect() {} +} + describe('', () => { + window.ResizeObserver = ResizeObserver; + test('is rendered', () => { const component = mountWithIntl( {}} /> diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.tsx index 239208e6752fc..93a2c6333f9cc 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.tsx @@ -7,7 +7,7 @@ */ import React, { useState, useRef, useCallback, useMemo, useEffect, KeyboardEvent } from 'react'; -import ReactResizeDetector from 'react-resize-detector'; +import { useResizeDetector } from 'react-resize-detector'; import ReactMonacoEditor from 'react-monaco-editor'; import { htmlIdGenerator, @@ -186,6 +186,13 @@ export const CodeEditor: React.FC = ({ _editor.current?.layout(); }, []); + useResizeDetector({ + handleWidth: true, + handleHeight: true, + onResize: _updateDimensions, + refreshMode: 'debounce', + }); + const startEditing = useCallback(() => { setIsHintActive(false); _editor.current?.focus(); @@ -469,12 +476,6 @@ export const CodeEditor: React.FC = ({ }} /> - ); }; diff --git a/src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx b/src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx index 33871742acbb3..f611c391a20a2 100644 --- a/src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx +++ b/src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx @@ -101,5 +101,5 @@ class ExitFullScreenButtonUi extends PureComponent { } } -/** @deprecated Use `ExitFullScreenButton` from `src/plugins/shared_ux/public`. */ +/** @deprecated Use `ExitFullScreenButton` from `@kbn/shared-ux-button-exit-full-screen`. */ export const ExitFullScreenButton = ExitFullScreenButtonUi; diff --git a/src/plugins/kibana_react/public/index.ts b/src/plugins/kibana_react/public/index.ts index 4b4c0b6e5ab20..2244d3d5503e0 100644 --- a/src/plugins/kibana_react/public/index.ts +++ b/src/plugins/kibana_react/public/index.ts @@ -82,7 +82,7 @@ export { reactToUiComponent, uiToReactComponent } from './adapters'; export { toMountPoint, MountPointPortal } from './util'; export type { ToMountPointOptions } from './util'; -/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-components */ +/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-link-redirect-app` */ export { RedirectAppLinks } from './app_links'; export { wrapWithTheme, KibanaThemeProvider } from './theme'; diff --git a/src/plugins/kibana_react/public/markdown/markdown_simple.tsx b/src/plugins/kibana_react/public/markdown/markdown_simple.tsx index 23a00fdec038b..24b9eee7b1ca5 100644 --- a/src/plugins/kibana_react/public/markdown/markdown_simple.tsx +++ b/src/plugins/kibana_react/public/markdown/markdown_simple.tsx @@ -6,20 +6,16 @@ * Side Public License, v 1. */ -import React, { Fragment } from 'react'; +import React from 'react'; import ReactMarkdown from 'react-markdown'; -const markdownRenderers = { - root: Fragment, -}; - export interface MarkdownSimpleProps { children: string; } // Render markdown string into JSX inside of a Fragment. export const MarkdownSimple = ({ children }: MarkdownSimpleProps) => ( - {children} + {children} ); // Needed for React.lazy diff --git a/src/plugins/kibana_react/public/page_template/page_template.tsx b/src/plugins/kibana_react/public/page_template/page_template.tsx index bd5213c9a2608..44edccd8ea49b 100644 --- a/src/plugins/kibana_react/public/page_template/page_template.tsx +++ b/src/plugins/kibana_react/public/page_template/page_template.tsx @@ -21,7 +21,7 @@ import { KibanaPageTemplateInner, KibanaPageTemplateWithSolutionNav } from './pa /** * A thin wrapper around EuiPageTemplate with a few Kibana specific additions - * @deprecated Use `KibanaPageTemplateProps` from `kbn-shared-ux-components`. + * @deprecated Use `KibanaPageTemplateProps` from `@kbn/shared-ux-page-kibana-template-types`. */ export type KibanaPageTemplateProps = EuiPageTemplateProps & { /** @@ -42,7 +42,7 @@ export type KibanaPageTemplateProps = EuiPageTemplateProps & { noDataConfig?: NoDataPageProps; }; -/** @deprecated Use `KibanaPageTemplate` from `kbn-shared-ux-components`. */ +/** @deprecated Use `KibanaPageTemplate` from `@kbn/shared-ux-page-kibana-template`. */ export const KibanaPageTemplate: FunctionComponent = ({ template, className, 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 f1b230b72c337..97431c638273d 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts @@ -430,10 +430,6 @@ export const stackManagementSchema: MakeSchemaFrom = { type: 'boolean', _meta: { description: 'Non-default value of setting.' }, }, - 'observability:enableInfrastructureView': { - type: 'boolean', - _meta: { description: 'Non-default value of setting.' }, - }, 'observability:enableServiceGroups': { 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 1a946e99f29bd..1b7a64d0cc590 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts @@ -41,7 +41,6 @@ export interface UsageStats { 'observability:enableNewSyntheticsView': boolean; 'observability:maxSuggestions': number; 'observability:enableComparisonByDefault': boolean; - 'observability:enableInfrastructureView': boolean; 'observability:enableServiceGroups': boolean; 'visualize:enableLabs': boolean; 'visualization:heatmap:maxBuckets': number; diff --git a/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx b/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx index b5e81707a7a79..452ef49881578 100644 --- a/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx +++ b/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { Fragment } from 'react'; +import React from 'react'; import { History } from 'history'; import { i18n } from '@kbn/i18n'; import { EuiLoadingSpinner } from '@elastic/eui'; @@ -20,7 +20,7 @@ import { KibanaThemeProvider } from '../theme'; const ReactMarkdown = React.lazy(() => import('react-markdown')); const ErrorRenderer = (props: { children: string }) => ( }> - + ); diff --git a/src/plugins/presentation_util/public/components/solution_toolbar/index.ts b/src/plugins/presentation_util/public/components/solution_toolbar/index.ts index 5828abda1107f..ee60678af5d87 100644 --- a/src/plugins/presentation_util/public/components/solution_toolbar/index.ts +++ b/src/plugins/presentation_util/public/components/solution_toolbar/index.ts @@ -7,5 +7,5 @@ */ export { SolutionToolbar } from './solution_toolbar'; -/** @deprecated QuickButtonGroup - use `IconButtonGroup` from `@kbn/shared-ux-components */ +/** @deprecated QuickButtonGroup - use `IconButtonGroup` from `@kbn/shared-ux-button-toolbar` */ export * from './items'; diff --git a/src/plugins/shared_ux/.i18nrc.json b/src/plugins/shared_ux/.i18nrc.json deleted file mode 100755 index cd7ac5b866df2..0000000000000 --- a/src/plugins/shared_ux/.i18nrc.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "prefix": "sharedUX", - "paths": { - "sharedUX": "." - }, - "translations": [ - "translations/ja-JP.json" - ] -} diff --git a/src/plugins/shared_ux/README.md b/src/plugins/shared_ux/README.md deleted file mode 100755 index 748414c356e9b..0000000000000 --- a/src/plugins/shared_ux/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# sharedUX - -Our mission is to make consistency in our user experience a product. - -## Areas of Focus - -### UX Infrastructure - -- Create and maintain a discoverable home for shared UX code. -- Encourage contribution and usage. - -### UX Patterns - -- Work with design specialists to understand and communicate new and existing designs. -- Foster adoption of design principles by codifying them in shared resources. - -### UX Solutions - -- Drive common projects. -- Build and support common plugins. -- Help teams to create consistent user experiences. - -## The sharedUX Plugin - -This plugin contains common code that is shared among other plugins. - -## Contribution - -Contributions are welcome and encouraged! \ No newline at end of file diff --git a/src/plugins/shared_ux/docs/about.mdx b/src/plugins/shared_ux/docs/about.mdx deleted file mode 100644 index 213ce774be217..0000000000000 --- a/src/plugins/shared_ux/docs/about.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: sharedUX/About -slug: /shared-ux/about -title: About Shared UX -description: . -date: 2021-01-05 -tags: ['shared-ux'] ---- - -Our mission is to make consistency in our user experience a product. - -## Areas of Focus - -### UX Infrastructure - -- Create and maintain a discoverable home for shared UX code. -- Encourage contribution and usage. - -### UX Patterns - -- Work with design specialists to understand and communicate new and existing designs. -- Foster adoption of design principles by codifying them in shared resources. - -### UX Solutions - -- Drive common projects. -- Build and support common plugins. -- Help teams to create consistent user experiences. - -## The sharedUX Plugin - -This plugin contains common code that is shared among other plugins. - -## Contribution - -Contributions are welcome and encouraged! diff --git a/src/plugins/shared_ux/kibana.json b/src/plugins/shared_ux/kibana.json deleted file mode 100755 index 308a252f70b54..0000000000000 --- a/src/plugins/shared_ux/kibana.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "sharedUX", - "version": "1.0.0", - "kibanaVersion": "kibana", - "owner": { - "name": "Shared UX", - "githubTeam": "shared-ux" - }, - "description": "A plugin providing components and services for shared user experiences in Kibana.", - "server": true, - "ui": true, - "requiredPlugins": ["dataViewEditor", "dataViews"], - "optionalPlugins": [] -} diff --git a/src/plugins/shared_ux/nav_shared_ux.docnav.json b/src/plugins/shared_ux/nav_shared_ux.docnav.json deleted file mode 100644 index 8f6ad010a49cb..0000000000000 --- a/src/plugins/shared_ux/nav_shared_ux.docnav.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "mission": "Shared UX", - "id": "sharedUX", - "landingPageId": "sharedUX/About", - "icon": "globe", - "description": "Developer documentation for Shared UX.", - "items": [ - { - "label": "About", - "items": [ - { - "id": "sharedUX/About" - } - ] - } - ] -} diff --git a/src/plugins/shared_ux/public/index.ts b/src/plugins/shared_ux/public/index.ts deleted file mode 100755 index 1dcf84eaf4991..0000000000000 --- a/src/plugins/shared_ux/public/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 { SharedUXPlugin } from './plugin'; - -/** - * Creates the Shared UX plugin. - */ -export function plugin() { - return new SharedUXPlugin(); -} - -export type { SharedUXPluginSetup, SharedUXPluginStart } from './types'; diff --git a/src/plugins/shared_ux/public/mocks.ts b/src/plugins/shared_ux/public/mocks.ts deleted file mode 100644 index c77236d503ca9..0000000000000 --- a/src/plugins/shared_ux/public/mocks.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 { SharedUXPlugin } from './plugin'; - -export type Setup = jest.Mocked>; -export type Start = jest.Mocked>; - -const createStartContract = (): jest.Mocked => { - const startContract = { - getContextServices: jest.fn(), - }; - return startContract; -}; - -export const sharedUXPluginMock = { - createStartContract, -}; diff --git a/src/plugins/shared_ux/public/plugin.ts b/src/plugins/shared_ux/public/plugin.ts deleted file mode 100755 index 8806de85b9304..0000000000000 --- a/src/plugins/shared_ux/public/plugin.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 '@kbn/core/public'; -import { - SharedUXPluginSetup, - SharedUXPluginStart, - SharedUXPluginStartDeps, - SharedUXPluginSetupDeps, -} from './types'; - -import { servicesFactory } from './services'; - -/** - * The Kibana plugin for Shared User Experience (Shared UX). - */ -export class SharedUXPlugin implements Plugin { - public setup( - _coreSetup: CoreSetup, - _setupPlugins: SharedUXPluginSetupDeps - ): SharedUXPluginSetup { - return {}; - } - - public start(coreStart: CoreStart, startPlugins: SharedUXPluginStartDeps): SharedUXPluginStart { - const services = servicesFactory({ coreStart, startPlugins }); - - return { - getContextServices: () => services, - }; - } - - public stop() {} -} diff --git a/src/plugins/shared_ux/public/services/application.ts b/src/plugins/shared_ux/public/services/application.ts deleted file mode 100644 index 95d6d4b4d72d9..0000000000000 --- a/src/plugins/shared_ux/public/services/application.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. - */ - -import { SharedUxApplicationService } from '@kbn/shared-ux-services'; - -import { KibanaPluginServiceFactory } from './types'; -import { SharedUXPluginStartDeps } from '../types'; - -export type ApplicationServiceFactory = KibanaPluginServiceFactory< - SharedUxApplicationService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXEditorsService`. - */ -export const applicationServiceFactory: ApplicationServiceFactory = ({ coreStart }) => ({ - navigateToUrl: coreStart.application.navigateToUrl, - currentAppId$: coreStart.application.currentAppId$, -}); diff --git a/src/plugins/shared_ux/public/services/data.ts b/src/plugins/shared_ux/public/services/data.ts deleted file mode 100644 index d68d35848e812..0000000000000 --- a/src/plugins/shared_ux/public/services/data.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. - */ - -import { SharedUxDataService } from '@kbn/shared-ux-services'; -import { KibanaPluginServiceFactory } from './types'; -import { SharedUXPluginStartDeps } from '../types'; - -export type DataServiceFactory = KibanaPluginServiceFactory< - SharedUxDataService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXDataService`. - */ -export const dataServiceFactory: DataServiceFactory = ({ coreStart, startPlugins }) => ({ - hasDataView: startPlugins.dataViews.hasData.hasDataView, - hasESData: startPlugins.dataViews.hasData.hasESData, - hasUserDataView: startPlugins.dataViews.hasData.hasUserDataView, -}); diff --git a/src/plugins/shared_ux/public/services/doc_links.ts b/src/plugins/shared_ux/public/services/doc_links.ts deleted file mode 100644 index b457cddb7c3bc..0000000000000 --- a/src/plugins/shared_ux/public/services/doc_links.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 { SharedUxDocLinksService } from '@kbn/shared-ux-services'; - -import { KibanaPluginServiceFactory } from './types'; -import { SharedUXPluginStartDeps } from '../types'; - -export type DocLinksServiceFactory = KibanaPluginServiceFactory< - SharedUxDocLinksService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXEditorsService`. - */ -export const docLinksServiceFactory: DocLinksServiceFactory = ({ coreStart }) => ({ - dataViewsDocLink: coreStart.docLinks.links.indexPatterns?.introduction, -}); diff --git a/src/plugins/shared_ux/public/services/editors.ts b/src/plugins/shared_ux/public/services/editors.ts deleted file mode 100644 index 498b42954091c..0000000000000 --- a/src/plugins/shared_ux/public/services/editors.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 { SharedUxEditorsService } from '@kbn/shared-ux-services'; - -import { KibanaPluginServiceFactory } from './types'; -import { SharedUXPluginStartDeps } from '../types'; - -export type EditorsServiceFactory = KibanaPluginServiceFactory< - SharedUxEditorsService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXEditorsService`. - */ -export const editorsServiceFactory: EditorsServiceFactory = ({ startPlugins }) => ({ - openDataViewEditor: startPlugins.dataViewEditor.openEditor, -}); diff --git a/src/plugins/shared_ux/public/services/http.ts b/src/plugins/shared_ux/public/services/http.ts deleted file mode 100644 index afc2f00713988..0000000000000 --- a/src/plugins/shared_ux/public/services/http.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 { SharedUxHttpService } from '@kbn/shared-ux-services'; - -import { KibanaPluginServiceFactory } from './types'; -import { SharedUXPluginStartDeps } from '../types'; - -export type HttpServiceFactory = KibanaPluginServiceFactory< - SharedUxHttpService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXEditorsService`. - */ -export const httpServiceFactory: HttpServiceFactory = ({ coreStart }) => ({ - addBasePath: coreStart.http.basePath.prepend, -}); diff --git a/src/plugins/shared_ux/public/services/index.ts b/src/plugins/shared_ux/public/services/index.ts deleted file mode 100644 index c8a572c262518..0000000000000 --- a/src/plugins/shared_ux/public/services/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { SharedUxServices } from '@kbn/shared-ux-services'; - -import type { SharedUXPluginStartDeps } from '../types'; -import type { KibanaPluginServiceFactory } from './types'; - -import { platformServiceFactory } from './platform'; -import { userPermissionsServiceFactory } from './permissions'; -import { editorsServiceFactory } from './editors'; -import { docLinksServiceFactory } from './doc_links'; -import { httpServiceFactory } from './http'; -import { applicationServiceFactory } from './application'; -import { dataServiceFactory } from './data'; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXServices`. - */ -export const servicesFactory: KibanaPluginServiceFactory< - SharedUxServices, - SharedUXPluginStartDeps -> = (params) => ({ - platform: platformServiceFactory(params), - permissions: userPermissionsServiceFactory(params), - editors: editorsServiceFactory(params), - docLinks: docLinksServiceFactory(params), - http: httpServiceFactory(params), - application: applicationServiceFactory(params), - data: dataServiceFactory(params), -}); diff --git a/src/plugins/shared_ux/public/services/permissions.ts b/src/plugins/shared_ux/public/services/permissions.ts deleted file mode 100644 index 694405b5c6610..0000000000000 --- a/src/plugins/shared_ux/public/services/permissions.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { SharedUxUserPermissionsService } from '@kbn/shared-ux-services'; -import { KibanaPluginServiceFactory } from './types'; -import { SharedUXPluginStartDeps } from '../types'; - -export type UserPermissionsServiceFactory = KibanaPluginServiceFactory< - SharedUxUserPermissionsService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXPermissionsService`. - */ -export const userPermissionsServiceFactory: UserPermissionsServiceFactory = ({ - coreStart, - startPlugins, -}) => ({ - canCreateNewDataView: startPlugins.dataViewEditor.userPermissions.editDataView(), - canAccessFleet: coreStart.application.capabilities.navLinks.integrations, -}); diff --git a/src/plugins/shared_ux/public/services/platform.ts b/src/plugins/shared_ux/public/services/platform.ts deleted file mode 100644 index b0ee61583dd8d..0000000000000 --- a/src/plugins/shared_ux/public/services/platform.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 { SharedUxPlatformService } from '@kbn/shared-ux-services'; -import { SharedUXPluginStartDeps } from '../types'; -import { KibanaPluginServiceFactory } from './types'; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXPlatformService`. - */ -export type PlatformServiceFactory = KibanaPluginServiceFactory< - SharedUxPlatformService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXPlatformService`. - */ -export const platformServiceFactory: PlatformServiceFactory = ({ coreStart }) => ({ - setIsFullscreen: (isVisible: boolean) => coreStart.chrome.setIsVisible(isVisible), -}); diff --git a/src/plugins/shared_ux/public/services/types.ts b/src/plugins/shared_ux/public/services/types.ts deleted file mode 100644 index 895b2fb231a37..0000000000000 --- a/src/plugins/shared_ux/public/services/types.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 { BehaviorSubject } from 'rxjs'; -import { CoreStart, AppUpdater, PluginInitializerContext } from '@kbn/core/public'; - -/** - * Parameters necessary to create a Kibana-based service, (e.g. during Plugin - * startup or setup). - * - * The `Start` generic refers to the specific Plugin `TPluginsStart`. - */ -export interface KibanaPluginServiceParams { - coreStart: CoreStart; - startPlugins: Start; - appUpdater?: BehaviorSubject; - initContext?: PluginInitializerContext; -} - -/** - * A factory function for creating a Kibana-based service. - * - * The `Service` generic determines the shape of the Service being produced. - * The `Start` generic refers to the specific Plugin `TPluginsStart`. - */ -export type KibanaPluginServiceFactory = ( - params: KibanaPluginServiceParams -) => Service; diff --git a/src/plugins/shared_ux/public/types/index.ts b/src/plugins/shared_ux/public/types/index.ts deleted file mode 100644 index e3e7cb760268f..0000000000000 --- a/src/plugins/shared_ux/public/types/index.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. - */ - -/* eslint-disable @typescript-eslint/no-empty-interface */ - -import { SharedUxServices } from '@kbn/shared-ux-services'; -import { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public'; -import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; - -/** @internal */ -export interface SharedUXPluginSetup {} - -/** - * The Shared UX plugin public contract, containing prewired components, services, and - * other constructs useful to consumers. - */ -export interface SharedUXPluginStart { - /** - * A set of pre-wired services for use with `SharedUxServicesProvider`. - * - * ``` - * import { SharedUxServicesProvider } from '@kbn/shared-ux-services'; - * - * public start(coreStart: CoreStart, startPlugins: MyPluginStartDeps): MyPluginStart { - * const services = startPlugins.sharedUX.getContextServices(); - * return { - * ServicesContext: ({ children }) => {children}, - * }; - * } - * ``` - * - * or - * - * ``` - * import { SharedUxServicesProvider } from '@kbn/shared-ux-services'; - * - * public setup(coreSetup: CoreSetup, setupPlugins: MyPluginSetupDeps): MyPluginSetup { - * const [coreStart, startPlugins] = await coreSetup.getStartServices(); - * coreSetup.application.register({ - * mount: async (params: AppMountParameters) => { - * ReactDOM.render( - * - * - * , - * params.element - * ); - * } - * ); - * } - * ``` - */ - getContextServices: () => SharedUxServices; -} - -/** @internal */ -export interface SharedUXPluginSetupDeps {} - -/** @internal */ -export interface SharedUXPluginStartDeps { - dataViewEditor: DataViewEditorStart; - dataViews: DataViewsPublicPluginStart; -} diff --git a/src/plugins/shared_ux/server/index.ts b/src/plugins/shared_ux/server/index.ts deleted file mode 100755 index 44c72b244aaf9..0000000000000 --- a/src/plugins/shared_ux/server/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { PluginInitializerContext } from '@kbn/core/server'; -import { SharedUXPlugin } from './plugin'; - -export function plugin(initializerContext: PluginInitializerContext) { - return new SharedUXPlugin(initializerContext); -} - -export type { SharedUXPluginSetup, SharedUXPluginStart } from './types'; diff --git a/src/plugins/shared_ux/server/plugin.ts b/src/plugins/shared_ux/server/plugin.ts deleted file mode 100755 index f0ea504884610..0000000000000 --- a/src/plugins/shared_ux/server/plugin.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 { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from '@kbn/core/server'; - -import { SharedUXPluginSetup, SharedUXPluginStart } from './types'; - -export class SharedUXPlugin implements Plugin { - private readonly logger: Logger; - - constructor(initializerContext: PluginInitializerContext) { - this.logger = initializerContext.logger.get(); - } - - public setup(_core: CoreSetup) { - this.logger.debug('sharedUX: Setup'); - return {}; - } - - public start(_core: CoreStart) { - this.logger.debug('sharedUX: Started'); - return {}; - } - - public stop() {} -} diff --git a/src/plugins/shared_ux/server/types.ts b/src/plugins/shared_ux/server/types.ts deleted file mode 100755 index b16a18467d309..0000000000000 --- a/src/plugins/shared_ux/server/types.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. - */ - -/* eslint-disable @typescript-eslint/no-empty-interface */ - -/** @internal */ -export interface SharedUXPluginSetup {} - -/** @internal */ -export interface SharedUXPluginStart {} diff --git a/src/plugins/shared_ux/tsconfig.json b/src/plugins/shared_ux/tsconfig.json deleted file mode 100644 index 3a287353a5341..0000000000000 --- a/src/plugins/shared_ux/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "../../../typings/**/*" - ], - "references": [ - { - "path": "../../core/tsconfig.json" - }, - { - "path": "../data_view_editor/tsconfig.json" - }, - { - "path": "../data_views/tsconfig.json" - } - ] -} diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index cacd8067e4e03..e59b192442133 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -8282,12 +8282,6 @@ "description": "Non-default value of setting." } }, - "observability:enableInfrastructureView": { - "type": "boolean", - "_meta": { - "description": "Non-default value of setting." - } - }, "observability:enableServiceGroups": { "type": "boolean", "_meta": { diff --git a/src/plugins/unified_search/public/actions/apply_filter_action.ts b/src/plugins/unified_search/public/actions/apply_filter_action.ts index e890cd94375c3..4f2900944f827 100644 --- a/src/plugins/unified_search/public/actions/apply_filter_action.ts +++ b/src/plugins/unified_search/public/actions/apply_filter_action.ts @@ -8,6 +8,7 @@ import { i18n } from '@kbn/i18n'; import { ThemeServiceSetup } from '@kbn/core/public'; +import type { IEmbeddable } from '@kbn/embeddable-plugin/public'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import { Action, createAction, IncompatibleActionError } from '@kbn/ui-actions-plugin/public'; // for cleanup esFilters need to fix the issue https://github.com/elastic/kibana/issues/131292 @@ -21,9 +22,7 @@ export const ACTION_GLOBAL_APPLY_FILTER = 'ACTION_GLOBAL_APPLY_FILTER'; export interface ApplyGlobalFilterActionContext { filters: Filter[]; timeFieldName?: string; - // Need to make this unknown to prevent circular dependencies. - // Apps using this property will need to cast to `IEmbeddable`. - embeddable?: unknown; + embeddable?: IEmbeddable; // controlledBy is an optional key in filter.meta that identifies the owner of a filter // Pass controlledBy to cleanup an existing filter(s) owned by embeddable prior to adding new filters controlledBy?: string; diff --git a/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx b/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx index 81534575d10b1..7cd8b9d0251d8 100644 --- a/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx +++ b/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx @@ -78,10 +78,10 @@ export default class IndexPatternSelect extends Component { - const idsAndTitles = await this.props.indexPatternService.getIdsWithTitle(); + const dataViews = await this.props.indexPatternService.getIdsWithTitle(); if (!this.isMounted || searchValue !== this.state.searchValue) { return; } const options = []; - for (let i = 0; i < idsAndTitles.length; i++) { - if (idsAndTitles[i].title.toLowerCase().includes(searchValue.toLowerCase())) { + for (let i = 0; i < dataViews.length; i++) { + const label = dataViews[i].name ? dataViews[i].name : dataViews[i].title; + if (label && label.toLowerCase().includes(searchValue.toLowerCase())) { options.push({ - label: idsAndTitles[i].title, - value: idsAndTitles[i].id, + label, + value: dataViews[i].id, }); } } diff --git a/src/plugins/unified_search/tsconfig.json b/src/plugins/unified_search/tsconfig.json index 41dc76f1305be..61b1f83058821 100644 --- a/src/plugins/unified_search/tsconfig.json +++ b/src/plugins/unified_search/tsconfig.json @@ -17,6 +17,7 @@ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, { "path": "../data_views/tsconfig.json" }, + { "path": "../embeddable/tsconfig.json" }, { "path": "../usage_collection/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, diff --git a/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_vars.js b/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_vars.js index 4ac63bd8704bc..cccc21e7cbdb1 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_vars.js +++ b/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_vars.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { startsWith, snakeCase } from 'lodash'; import { BUCKET_TYPES, DATA_FORMATTERS } from '../../../../common/enums'; import { getLastValue } from '../../../../common/last_value_utils'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/vis.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/vis.js index dc3922453a0e2..66a01793a0e96 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/vis.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/vis.js @@ -10,7 +10,7 @@ import _, { isArray, last, get } from 'lodash'; import React, { Component } from 'react'; import { parse as parseUrl } from 'url'; import PropTypes from 'prop-types'; -import { RedirectAppLinks } from '@kbn/kibana-react-plugin/public'; +import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; import { getMetricsField } from '../../lib/get_metrics_field'; import { createTickFormatter } from '../../lib/tick_formatter'; import { createFieldFormatter } from '../../lib/create_field_formatter'; @@ -271,15 +271,13 @@ class TableVis extends Component { return ( - - - {header} - {rows} -
+ +
+ + {header} + {rows} +
+
{accessDeniedDrilldownUrl && ( (accessor ?? '').split('-').pop() ?? ''; + export interface Serie { id: string; rawId: string; diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis_config.js b/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis_config.js index 18958b6439a8c..2a5ab819c00ac 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis_config.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis_config.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import d3 from 'd3'; import { SCALE_MODES } from './scale_modes'; diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/chart_grid.js b/src/plugins/vis_types/vislib/public/vislib/lib/chart_grid.js index 32a41ec5ed489..a9ffe384ee78f 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/chart_grid.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/chart_grid.js @@ -7,7 +7,7 @@ */ import d3 from 'd3'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; const defaults = { diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/vis_config.js b/src/plugins/vis_types/vislib/public/vislib/lib/vis_config.js index cc9e48897d053..3b60481c0affe 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/vis_config.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/vis_config.js @@ -9,7 +9,7 @@ /** * Provides vislib configuration, throws error if invalid property is accessed without providing defaults */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import { vislibTypesConfig as visTypes } from './types'; import { Data } from './data'; diff --git a/src/plugins/vis_types/xy/common/index.ts b/src/plugins/vis_types/xy/common/index.ts index f17bc8476d9a6..da2c02d6145d2 100644 --- a/src/plugins/vis_types/xy/common/index.ts +++ b/src/plugins/vis_types/xy/common/index.ts @@ -14,8 +14,3 @@ export enum ChartType { Area = 'area', Histogram = 'histogram', } - -/** - * Type of xy visualizations - */ -export type XyVisType = ChartType | 'horizontal_bar'; diff --git a/src/plugins/vis_types/xy/kibana.json b/src/plugins/vis_types/xy/kibana.json index 45f1c36331dfb..fa942c1530142 100644 --- a/src/plugins/vis_types/xy/kibana.json +++ b/src/plugins/vis_types/xy/kibana.json @@ -3,9 +3,8 @@ "version": "kibana", "ui": true, "server": true, - "requiredPlugins": ["charts", "data", "expressions", "visualizations", "fieldFormats"], - "requiredBundles": ["kibanaUtils", "visDefaultEditor", "kibanaReact"], - "optionalPlugins": ["usageCollection"], + "requiredPlugins": ["charts", "visualizations", "data", "expressions"], + "requiredBundles": ["kibanaUtils", "visDefaultEditor"], "extraPublicDirs": ["common/index"], "owner": { "name": "Vis Editors", diff --git a/src/plugins/vis_types/xy/public/_chart.scss b/src/plugins/vis_types/xy/public/_chart.scss deleted file mode 100644 index ac9d4ed04aec4..0000000000000 --- a/src/plugins/vis_types/xy/public/_chart.scss +++ /dev/null @@ -1,7 +0,0 @@ -.xyChart__container { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; -} diff --git a/src/plugins/vis_types/xy/public/chart_split.tsx b/src/plugins/vis_types/xy/public/chart_split.tsx deleted file mode 100644 index e1d096334f17c..0000000000000 --- a/src/plugins/vis_types/xy/public/chart_split.tsx +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { Accessor, AccessorFn, GroupBy, SmallMultiples, Predicate } from '@elastic/charts'; - -interface ChartSplitProps { - splitColumnAccessor?: Accessor | AccessorFn; - splitRowAccessor?: Accessor | AccessorFn; -} - -const CHART_SPLIT_ID = '__chart_split__'; - -export const ChartSplit = ({ splitColumnAccessor, splitRowAccessor }: ChartSplitProps) => { - if (!splitColumnAccessor && !splitRowAccessor) return null; - - return ( - <> - { - const splitTypeAccessor = splitColumnAccessor || splitRowAccessor; - if (splitTypeAccessor) { - return typeof splitTypeAccessor === 'function' - ? splitTypeAccessor(datum) - : datum[splitTypeAccessor]; - } - return spec.id; - }} - sort={Predicate.DataIndex} - /> - - - ); -}; diff --git a/src/plugins/vis_types/xy/public/components/_detailed_tooltip.scss b/src/plugins/vis_types/xy/public/components/_detailed_tooltip.scss deleted file mode 100644 index 91b0a8d023290..0000000000000 --- a/src/plugins/vis_types/xy/public/components/_detailed_tooltip.scss +++ /dev/null @@ -1,34 +0,0 @@ -.detailedTooltip { - @include euiToolTipStyle('s'); - pointer-events: none; - max-width: $euiSizeXL * 10; - overflow: hidden; - padding: $euiSizeS; - - table { - td, - th { - text-align: left; - padding: $euiSizeXS; - overflow-wrap: break-word; - word-wrap: break-word; - } - } -} - -.detailedTooltip__header { - > :last-child { - margin-bottom: $euiSizeS; - } -} - -.detailedTooltip__labelContainer, -.detailedTooltip__valueContainer { - overflow-wrap: break-word; - word-wrap: break-word; -} - -.detailedTooltip__label { - font-weight: $euiFontWeightMedium; - color: shade($euiColorGhost, 20%); -} diff --git a/src/plugins/vis_types/xy/public/components/detailed_tooltip.mock.ts b/src/plugins/vis_types/xy/public/components/detailed_tooltip.mock.ts deleted file mode 100644 index bc6a1f292dad3..0000000000000 --- a/src/plugins/vis_types/xy/public/components/detailed_tooltip.mock.ts +++ /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 and the Server Side Public License, v 1; you may 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 aspects = { - x: { - accessor: 'col-0-3', - column: 0, - title: 'timestamp per 3 hours', - format: { - id: 'date', - params: { - pattern: 'YYYY-MM-DD HH:mm', - }, - }, - aggType: 'date_histogram', - aggId: '3', - params: { - date: true, - intervalESUnit: 'h', - intervalESValue: 3, - interval: 10800000, - format: 'YYYY-MM-DD HH:mm', - }, - }, - y: [ - { - accessor: 'col-1-1', - column: 1, - title: 'Count', - format: { - id: 'number', - }, - aggType: 'count', - aggId: '1', - params: {}, - }, - ], -}; - -export const aspectsWithSplitColumn = { - x: { - accessor: 'col-0-3', - column: 0, - title: 'timestamp per 3 hours', - format: { - id: 'date', - params: { - pattern: 'YYYY-MM-DD HH:mm', - }, - }, - aggType: 'date_histogram', - aggId: '3', - params: { - date: true, - intervalESUnit: 'h', - intervalESValue: 3, - interval: 10800000, - format: 'YYYY-MM-DD HH:mm', - }, - }, - y: [ - { - accessor: 'col-2-1', - column: 2, - title: 'Count', - format: { - id: 'number', - }, - aggType: 'count', - aggId: '1', - params: {}, - }, - ], - splitColumn: { - accessor: 'col-1-4', - column: 1, - title: 'Cancelled: Descending', - format: { - id: 'terms', - params: { - id: 'boolean', - otherBucketLabel: 'Other', - missingBucketLabel: 'Missing', - }, - }, - aggType: 'terms', - aggId: '4', - params: {}, - }, -}; - -export const aspectsWithSplitRow = { - x: { - accessor: 'col-0-3', - column: 0, - title: 'timestamp per 3 hours', - format: { - id: 'date', - params: { - pattern: 'YYYY-MM-DD HH:mm', - }, - }, - aggType: 'date_histogram', - aggId: '3', - params: { - date: true, - intervalESUnit: 'h', - intervalESValue: 3, - interval: 10800000, - format: 'YYYY-MM-DD HH:mm', - }, - }, - y: [ - { - accessor: 'col-3-1', - column: 2, - title: 'Count', - format: { - id: 'number', - }, - aggType: 'count', - aggId: '1', - params: {}, - }, - ], - splitRow: { - accessor: 'col-1-5', - column: 1, - title: 'Carrier: Descending', - format: { - id: 'terms', - params: { - id: 'string', - otherBucketLabel: 'Other', - missingBucketLabel: 'Missing', - }, - }, - aggType: 'terms', - aggId: '4', - params: {}, - }, -}; - -export const header = { - seriesIdentifier: { - key: 'groupId{__pseudo_stacked_group-ValueAxis-1__}spec{area-col-1-1}yAccessor{col-1-1}splitAccessors{}smV{__ECH_DEFAULT_SINGLE_PANEL_SM_VALUE__}smH{__ECH_DEFAULT_SINGLE_PANEL_SM_VALUE__}', - specId: 'area-col-1-1', - yAccessor: 'col-1-1', - splitAccessors: {}, - seriesKeys: ['col-1-1'], - smVerticalAccessorValue: '__ECH_DEFAULT_SINGLE_PANEL_SM_VALUE__', - smHorizontalAccessorValue: '__ECH_DEFAULT_SINGLE_PANEL_SM_VALUE__', - }, - valueAccessor: 'y1', - label: 'Count', - value: 1611817200000, - formattedValue: '1611817200000', - markValue: null, - color: '#54b399', - isHighlighted: false, - isVisible: true, -}; - -export const value = { - seriesIdentifier: { - key: 'groupId{__pseudo_stacked_group-ValueAxis-1__}spec{area-col-1-1}yAccessor{col-1-1}splitAccessors{}smV{__ECH_DEFAULT_SINGLE_PANEL_SM_VALUE__}smH{__ECH_DEFAULT_SINGLE_PANEL_SM_VALUE__}', - specId: 'area-col-1-1', - yAccessor: 'col-1-1', - splitAccessors: [], - seriesKeys: ['col-1-1'], - smVerticalAccessorValue: 'kibana', - smHorizontalAccessorValue: 'false', - }, - valueAccessor: 'y1', - label: 'Count', - value: 52, - formattedValue: '52', - markValue: null, - color: '#54b399', - isHighlighted: true, - isVisible: true, -}; diff --git a/src/plugins/vis_types/xy/public/components/detailed_tooltip.test.tsx b/src/plugins/vis_types/xy/public/components/detailed_tooltip.test.tsx deleted file mode 100644 index aa76b680f6cc0..0000000000000 --- a/src/plugins/vis_types/xy/public/components/detailed_tooltip.test.tsx +++ /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 { getTooltipData } from './detailed_tooltip'; -import { - aspects, - aspectsWithSplitColumn, - aspectsWithSplitRow, - header, - value, -} from './detailed_tooltip.mock'; - -describe('getTooltipData', () => { - it('returns an array with the header and data information', () => { - const tooltipData = getTooltipData(aspects, header, value); - expect(tooltipData).toStrictEqual([ - { - label: 'timestamp per 3 hours', - value: '1611817200000', - }, - { - label: 'Count', - value: '52', - }, - ]); - }); - - it('returns an array with the data information if the header is not applied', () => { - const tooltipData = getTooltipData(aspects, null, value); - expect(tooltipData).toStrictEqual([ - { - label: 'Count', - value: '52', - }, - ]); - }); - - it('returns an array with the split column information if it is provided', () => { - const tooltipData = getTooltipData(aspectsWithSplitColumn, null, value); - expect(tooltipData).toStrictEqual([ - { - label: 'Cancelled: Descending', - value: 'false', - }, - ]); - }); - - it('returns an array with the split row information if it is provided', () => { - const tooltipData = getTooltipData(aspectsWithSplitRow, null, value); - expect(tooltipData).toStrictEqual([ - { - label: 'Carrier: Descending', - value: 'kibana', - }, - ]); - }); -}); diff --git a/src/plugins/vis_types/xy/public/components/detailed_tooltip.tsx b/src/plugins/vis_types/xy/public/components/detailed_tooltip.tsx deleted file mode 100644 index a7eb7a909615b..0000000000000 --- a/src/plugins/vis_types/xy/public/components/detailed_tooltip.tsx +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { isNil } from 'lodash'; - -import { - CustomTooltip, - TooltipValue, - TooltipValueFormatter, - XYChartSeriesIdentifier, -} from '@elastic/charts'; - -import { Aspects } from '../types'; - -import './_detailed_tooltip.scss'; -import { COMPLEX_SPLIT_ACCESSOR, isRangeAggType } from '../utils/accessors'; - -interface TooltipData { - label: string; - value: string; -} - -export const getTooltipData = ( - aspects: Aspects, - header: TooltipValue | null, - value: TooltipValue -): TooltipData[] => { - const data: TooltipData[] = []; - - if (header) { - const xFormatter = isRangeAggType(aspects.x.aggType) ? null : aspects.x.formatter; - data.push({ - label: aspects.x.title, - value: xFormatter ? xFormatter(header.value) : `${header.value}`, - }); - } - - const valueSeries = value.seriesIdentifier as XYChartSeriesIdentifier; - const yAccessor = aspects.y.find(({ accessor }) => accessor === valueSeries.yAccessor) ?? null; - - if (yAccessor) { - data.push({ - label: yAccessor.title, - value: yAccessor.formatter ? yAccessor.formatter(value.value) : `${value.value}`, - }); - } - - if (aspects.z && !isNil(value.markValue)) { - data.push({ - label: aspects.z.title, - value: aspects.z.formatter ? aspects.z.formatter(value.markValue) : `${value.markValue}`, - }); - } - - valueSeries.splitAccessors.forEach((splitValue, key) => { - const split = (aspects.series ?? []).find(({ accessor }, i) => { - return accessor === key || key === `${COMPLEX_SPLIT_ACCESSOR}::${i}`; - }); - - if (split) { - data.push({ - label: split?.title, - value: - split?.formatter && !key.toString().startsWith(COMPLEX_SPLIT_ACCESSOR) - ? split?.formatter(splitValue) - : `${splitValue}`, - }); - } - }); - - if ( - aspects.splitColumn && - valueSeries.smHorizontalAccessorValue !== undefined && - valueSeries.smHorizontalAccessorValue !== undefined - ) { - data.push({ - label: aspects.splitColumn.title, - value: `${valueSeries.smHorizontalAccessorValue}`, - }); - } - - if ( - aspects.splitRow && - valueSeries.smVerticalAccessorValue !== undefined && - valueSeries.smVerticalAccessorValue !== undefined - ) { - data.push({ - label: aspects.splitRow.title, - value: `${valueSeries.smVerticalAccessorValue}`, - }); - } - - return data; -}; - -const renderData = ({ label, value }: TooltipData, index: number) => { - return label && value ? ( - - -
{label}
- - - -
{value}
- - - ) : null; -}; - -export const getDetailedTooltip = - (aspects: Aspects) => - (headerFormatter?: TooltipValueFormatter): CustomTooltip => { - return function DetailedTooltip({ header, values }) { - // Note: first value is not necessarily the closest value - // To be fixed with https://github.com/elastic/elastic-charts/issues/835 - // TODO: Allow multiple values to be displayed in tooltip - const highlightedValue = values.find(({ isHighlighted }) => isHighlighted); - - if (!highlightedValue) { - return null; - } - - const tooltipData = getTooltipData(aspects, header, highlightedValue); - - if (tooltipData.length === 0) { - return null; - } - - return ( -
- {headerFormatter && header && ( -
{headerFormatter(header)}
- )} - - {tooltipData.map(renderData)} -
-
- ); - }; - }; diff --git a/src/plugins/vis_types/xy/public/components/index.ts b/src/plugins/vis_types/xy/public/components/index.ts deleted file mode 100644 index 7aaeb17ab2828..0000000000000 --- a/src/plugins/vis_types/xy/public/components/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 { XYAxis } from './xy_axis'; -export { XYEndzones } from './xy_endzones'; -export { XYCurrentTime } from './xy_current_time'; -export { XYSettings } from './xy_settings'; -export { XYThresholdLine } from './xy_threshold_line'; diff --git a/src/plugins/vis_types/xy/public/components/xy_axis.tsx b/src/plugins/vis_types/xy/public/components/xy_axis.tsx deleted file mode 100644 index b224639bdbff3..0000000000000 --- a/src/plugins/vis_types/xy/public/components/xy_axis.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, { FC } from 'react'; - -import { Axis } from '@elastic/charts'; - -import { AxisConfig } from '../types'; - -type XYAxisPros = AxisConfig; - -export const XYAxis: FC = ({ - id, - title, - show, - position, - groupId, - grid, - ticks, - domain, - style, - integersOnly, - timeAxisLayerCount, -}) => ( - -); diff --git a/src/plugins/vis_types/xy/public/components/xy_current_time.tsx b/src/plugins/vis_types/xy/public/components/xy_current_time.tsx deleted file mode 100644 index 68f1dd0d60b13..0000000000000 --- a/src/plugins/vis_types/xy/public/components/xy_current_time.tsx +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { FC } from 'react'; -import { DomainRange } from '@elastic/charts'; -import { CurrentTime } from '@kbn/charts-plugin/public'; - -interface XYCurrentTime { - enabled: boolean; - isDarkMode: boolean; - domain?: DomainRange; -} - -export const XYCurrentTime: FC = ({ enabled, isDarkMode, domain }) => { - if (!enabled) { - return null; - } - - const domainEnd = domain && 'max' in domain ? domain.max : undefined; - return ; -}; diff --git a/src/plugins/vis_types/xy/public/components/xy_endzones.tsx b/src/plugins/vis_types/xy/public/components/xy_endzones.tsx deleted file mode 100644 index 50982cc30dc3c..0000000000000 --- a/src/plugins/vis_types/xy/public/components/xy_endzones.tsx +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { FC } from 'react'; - -import { DomainRange } from '@elastic/charts'; - -import { Endzones } from '@kbn/charts-plugin/public'; - -interface XYEndzones { - enabled: boolean; - isDarkMode: boolean; - isFullBin: boolean; - hideTooltips?: boolean; - domain?: DomainRange; - adjustedDomain?: DomainRange; -} - -export const XYEndzones: FC = ({ - enabled, - isDarkMode, - isFullBin, - hideTooltips, - domain, - adjustedDomain, -}) => { - if ( - enabled && - domain && - adjustedDomain && - 'min' in domain && - 'max' in domain && - domain.minInterval !== undefined && - 'min' in adjustedDomain && - 'max' in adjustedDomain - ) { - return ( - - ); - } - - return null; -}; diff --git a/src/plugins/vis_types/xy/public/components/xy_settings.tsx b/src/plugins/vis_types/xy/public/components/xy_settings.tsx deleted file mode 100644 index f934a2c203196..0000000000000 --- a/src/plugins/vis_types/xy/public/components/xy_settings.tsx +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { FC } from 'react'; - -import { - Direction, - Settings, - SettingsProps, - DomainRange, - Position, - PartialTheme, - ElementClickListener, - BrushEndListener, - RenderChangeListener, - LegendAction, - LegendColorPicker, - TooltipProps, - TickFormatter, - VerticalAlignment, - HorizontalAlignment, -} from '@elastic/charts'; - -import { renderEndzoneTooltip } from '@kbn/charts-plugin/public'; - -import { getThemeService } from '../services'; -import { VisConfig } from '../types'; - -declare global { - interface Window { - /** - * Flag used to enable debugState on elastic charts - */ - _echDebugStateFlag?: boolean; - } -} - -type XYSettingsProps = Pick< - VisConfig, - | 'markSizeRatio' - | 'rotation' - | 'enableHistogramMode' - | 'tooltip' - | 'isTimeChart' - | 'xAxis' - | 'orderBucketsBySum' -> & { - onPointerUpdate: SettingsProps['onPointerUpdate']; - externalPointerEvents: SettingsProps['externalPointerEvents']; - xDomain?: DomainRange; - adjustedXDomain?: DomainRange; - showLegend: boolean; - onElementClick: ElementClickListener; - onBrushEnd?: BrushEndListener; - onRenderChange: RenderChangeListener; - legendAction?: LegendAction; - legendColorPicker: LegendColorPicker; - legendPosition: Position; - truncateLegend: boolean; - maxLegendLines: number; - legendSize?: number; - ariaLabel?: string; -}; - -function getValueLabelsStyling() { - const VALUE_LABELS_MAX_FONTSIZE = 12; - const VALUE_LABELS_MIN_FONTSIZE = 10; - - return { - displayValue: { - fontSize: { min: VALUE_LABELS_MIN_FONTSIZE, max: VALUE_LABELS_MAX_FONTSIZE }, - alignment: { horizontal: HorizontalAlignment.Center, vertical: VerticalAlignment.Middle }, - }, - }; -} - -export const XYSettings: FC = ({ - markSizeRatio, - rotation, - enableHistogramMode, - tooltip, - isTimeChart, - xAxis, - orderBucketsBySum, - xDomain, - adjustedXDomain, - showLegend, - onElementClick, - onPointerUpdate, - externalPointerEvents, - onBrushEnd, - onRenderChange, - legendAction, - legendColorPicker, - legendPosition, - maxLegendLines, - truncateLegend, - legendSize, - ariaLabel, -}) => { - const themeService = getThemeService(); - const theme = themeService.useChartsTheme(); - const baseTheme = themeService.useChartsBaseTheme(); - const valueLabelsStyling = getValueLabelsStyling(); - - const themeOverrides: PartialTheme = { - markSizeRatio, - barSeriesStyle: { - ...valueLabelsStyling, - }, - crosshair: { - ...theme.crosshair, - }, - legend: { - labelOptions: { maxLines: truncateLegend ? maxLegendLines ?? 1 : 0 }, - }, - axes: { - axisTitle: { - padding: { - outer: 10, - }, - }, - }, - chartMargins: - legendPosition === Position.Top || legendPosition === Position.Right - ? { - bottom: (theme.chartMargins?.bottom ?? 0) + 10, - } - : { - right: (theme.chartMargins?.right ?? 0) + 10, - }, - }; - - const headerValueFormatter: TickFormatter | undefined = xAxis.ticks?.formatter - ? (value) => xAxis.ticks?.formatter?.(value) ?? '' - : undefined; - const headerFormatter = - isTimeChart && xDomain && adjustedXDomain - ? renderEndzoneTooltip( - xDomain.minInterval, - 'min' in xDomain ? xDomain.min : undefined, - 'max' in xDomain ? xDomain.max : undefined, - headerValueFormatter, - !tooltip.detailedTooltip - ) - : headerValueFormatter && - (tooltip.detailedTooltip ? undefined : ({ value }: any) => headerValueFormatter(value)); - - const boundary = document.getElementById('app-fixed-viewport') ?? undefined; - const tooltipProps: TooltipProps = tooltip.detailedTooltip - ? { - ...tooltip, - boundary, - customTooltip: tooltip.detailedTooltip(headerFormatter), - headerFormatter: undefined, - } - : { ...tooltip, boundary, headerFormatter }; - - return ( - - ); -}; diff --git a/src/plugins/vis_types/xy/public/components/xy_threshold_line.tsx b/src/plugins/vis_types/xy/public/components/xy_threshold_line.tsx deleted file mode 100644 index f28dbf726d287..0000000000000 --- a/src/plugins/vis_types/xy/public/components/xy_threshold_line.tsx +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { FC } from 'react'; - -import { AnnotationDomainType, LineAnnotation } from '@elastic/charts'; - -import { ThresholdLineConfig } from '../types'; - -type XYThresholdLineProps = ThresholdLineConfig & { - groupId?: string; -}; - -export const XYThresholdLine: FC = ({ - show, - value: dataValue, - color, - width, - groupId, - dash, -}) => { - if (!show) { - return null; - } - - return ( - - ); -}; diff --git a/src/plugins/vis_types/xy/public/config/get_agg_id.ts b/src/plugins/vis_types/xy/public/config/get_agg_id.ts deleted file mode 100644 index 9586d0f082c1a..0000000000000 --- a/src/plugins/vis_types/xy/public/config/get_agg_id.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. - */ - -/** - * Get agg id from accessor - * - * For now this is determined by the esaggs column name. Could be cleaned up in the future. - */ -export const getAggId = (accessor: string) => (accessor ?? '').split('-').pop() ?? ''; diff --git a/src/plugins/vis_types/xy/public/config/get_aspects.ts b/src/plugins/vis_types/xy/public/config/get_aspects.ts deleted file mode 100644 index ee4b403301d87..0000000000000 --- a/src/plugins/vis_types/xy/public/config/get_aspects.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 { compact } from 'lodash'; - -import { i18n } from '@kbn/i18n'; - -import { DatatableColumn } from '@kbn/expressions-plugin/public'; - -import { Aspect, Dimension, Aspects, Dimensions } from '../types'; -import { getFormatService } from '../services'; -import { getAggId } from './get_agg_id'; - -export function getEmptyAspect(): Aspect { - return { - accessor: null, - aggId: null, - aggType: null, - title: i18n.translate('visTypeXy.aggResponse.allDocsTitle', { - defaultMessage: 'All docs', - }), - params: { - defaultValue: '_all', - }, - }; -} -export function getAspects( - columns: DatatableColumn[], - { x, y, z, series, splitColumn, splitRow }: Dimensions -): Aspects { - const seriesDimensions = Array.isArray(series) || series === undefined ? series : [series]; - - return { - x: getAspectsFromDimension(columns, x) ?? getEmptyAspect(), - y: getAspectsFromDimension(columns, y) ?? [], - z: z && z?.length > 0 ? getAspectsFromDimension(columns, z[0]) : undefined, - series: getAspectsFromDimension(columns, seriesDimensions), - splitColumn: splitColumn?.length ? getAspectsFromDimension(columns, splitColumn[0]) : undefined, - splitRow: splitRow?.length ? getAspectsFromDimension(columns, splitRow[0]) : undefined, - }; -} - -function getAspectsFromDimension( - columns: DatatableColumn[], - dimension?: Dimension | null -): Aspect | undefined; -function getAspectsFromDimension( - columns: DatatableColumn[], - dimensions?: Dimension[] | null -): Aspect[] | undefined; -function getAspectsFromDimension( - columns: DatatableColumn[], - dimensions?: Dimension | Dimension[] | null -): Aspect[] | Aspect | undefined { - if (!dimensions) { - return; - } - - if (Array.isArray(dimensions)) { - return compact( - dimensions.map((d) => { - const column = d && columns[d.accessor]; - return column && getAspect(column, d); - }) - ); - } - - const column = columns[dimensions.accessor]; - return column && getAspect(column, dimensions); -} - -const getAspect = ( - { id: accessor, name: title }: DatatableColumn, - { accessor: column, format, params, aggType }: Dimension -): Aspect => ({ - accessor, - column, - title, - format, - aggType, - aggId: getAggId(accessor), - formatter: (value: any) => getFormatService().deserialize(format).convert(value), - params, -}); diff --git a/src/plugins/vis_types/xy/public/config/get_axis.test.ts b/src/plugins/vis_types/xy/public/config/get_axis.test.ts deleted file mode 100644 index 7dddae5702b2e..0000000000000 --- a/src/plugins/vis_types/xy/public/config/get_axis.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 { getScale } from './get_axis'; -import type { Scale } from '../types'; - -describe('getScale', () => { - const axisScale = { - type: 'linear', - mode: 'normal', - scaleType: 'linear', - } as Scale; - - it('returns linear type for a number', () => { - const format = { id: 'number' }; - const scale = getScale(axisScale, {}, format, true); - expect(scale.type).toBe('linear'); - }); - - it('returns ordinal type for a terms aggregation on a number field', () => { - const format = { - id: 'terms', - params: { - id: 'number', - otherBucketLabel: 'Other', - missingBucketLabel: 'Missing', - }, - }; - const scale = getScale(axisScale, {}, format, true); - expect(scale.type).toBe('ordinal'); - }); - - it('returns ordinal type for a terms aggregation on a string field', () => { - const format = { - id: 'terms', - params: { - id: 'string', - otherBucketLabel: 'Other', - missingBucketLabel: 'Missing', - }, - }; - const scale = getScale(axisScale, {}, format, true); - expect(scale.type).toBe('ordinal'); - }); - - it('returns ordinal type for a range aggregation on a number field', () => { - const format = { - id: 'range', - params: { - id: 'number', - }, - }; - const scale = getScale(axisScale, {}, format, true); - expect(scale.type).toBe('ordinal'); - }); - - it('returns time type for a date histogram aggregation', () => { - const format = { - id: 'date', - params: { - pattern: 'HH:mm', - }, - }; - const scale = getScale(axisScale, { date: true }, format, true); - expect(scale.type).toBe('time'); - }); - - it('returns linear type for an histogram aggregation', () => { - const format = { id: 'number' }; - const scale = getScale(axisScale, { interval: 1 }, format, true); - expect(scale.type).toBe('linear'); - }); -}); diff --git a/src/plugins/vis_types/xy/public/config/get_axis.ts b/src/plugins/vis_types/xy/public/config/get_axis.ts deleted file mode 100644 index 62e2345c80566..0000000000000 --- a/src/plugins/vis_types/xy/public/config/get_axis.ts +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { identity } from 'lodash'; - -import { AxisSpec, TickFormatter, YDomainRange, ScaleType as ECScaleType } from '@elastic/charts'; - -import { LabelRotation } from '@kbn/charts-plugin/public'; -import { BUCKET_TYPES } from '@kbn/data-plugin/public'; -import { MULTILAYER_TIME_AXIS_STYLE } from '@kbn/charts-plugin/common'; - -import { - Aspect, - CategoryAxis, - Grid, - AxisConfig, - TickOptions, - ScaleConfig, - Scale, - ScaleType, - AxisType, - XScaleType, - YScaleType, - SeriesParam, -} from '../types'; - -export function getAxis( - { type, title: axisTitle, labels, scale: axisScale, ...axis }: CategoryAxis, - { categoryLines, valueAxis }: Grid, - { params, format, formatter, title: fallbackTitle = '', aggType }: Aspect, - seriesParams: SeriesParam[], - isDateHistogram = false, - useMultiLayerTimeAxis = false, - darkMode = false -): AxisConfig { - const isCategoryAxis = type === AxisType.Category; - // Hide unassigned axis, not supported in elastic charts - // TODO: refactor when disallowing unassigned axes - // https://github.com/elastic/kibana/issues/82752 - const show = - (isCategoryAxis || seriesParams.some(({ valueAxis: id }) => id === axis.id)) && axis.show; - const groupId = axis.id; - - const grid = isCategoryAxis - ? { - show: categoryLines, - } - : { - show: valueAxis === axis.id, - }; - // Date range formatter applied on xAccessor - const tickFormatter = - aggType === BUCKET_TYPES.DATE_RANGE || aggType === BUCKET_TYPES.RANGE ? identity : formatter; - const ticks: TickOptions = { - formatter: tickFormatter, - labelFormatter: getLabelFormatter(labels.truncate, tickFormatter), - show: labels.show, - rotation: labels.rotate, - showOverlappingLabels: !labels.filter, - showDuplicates: !labels.filter, - }; - const scale = getScale(axisScale, params, format, isCategoryAxis); - const title = axisTitle.text || fallbackTitle; - const fallbackRotation = - isCategoryAxis && isDateHistogram ? LabelRotation.Horizontal : LabelRotation.Vertical; - - return { - ...axis, - show, - groupId, - title, - ticks, - grid, - scale, - style: getAxisStyle(useMultiLayerTimeAxis, darkMode, ticks, title, fallbackRotation), - domain: getAxisDomain(scale, isCategoryAxis), - integersOnly: aggType === 'count', - timeAxisLayerCount: useMultiLayerTimeAxis ? 3 : 0, - }; -} - -function getLabelFormatter( - truncate?: number | null, - formatter?: TickFormatter -): TickFormatter | undefined { - if (truncate === null || truncate === undefined) { - return formatter; - } - - return (value: any) => { - const finalValue = `${formatter ? formatter(value) : value}`; - - if (finalValue.length > truncate) { - return `${finalValue.slice(0, truncate)}...`; - } - - return finalValue; - }; -} - -function getScaleType( - scale?: Scale, - isNumber?: boolean, - isTime = false, - isHistogram = false -): ECScaleType | undefined { - if (isTime) return ECScaleType.Time; - if (isHistogram) return ECScaleType.Linear; - - if (!isNumber) { - return ECScaleType.Ordinal; - } - - const type = scale?.type; - if (type === ScaleType.SquareRoot) { - return ECScaleType.Sqrt; - } - - return type; -} - -export function getScale( - scale: Scale, - params: Aspect['params'], - format: Aspect['format'], - isCategoryAxis: boolean -): ScaleConfig { - const type = ( - isCategoryAxis - ? getScaleType( - scale, - format?.id === 'number' || - (format?.params?.id === 'number' && - format?.id !== BUCKET_TYPES.RANGE && - format?.id !== BUCKET_TYPES.TERMS), - 'date' in params, - 'interval' in params - ) - : getScaleType(scale, true) - ) as S; - - return { - ...scale, - type, - }; -} - -function getAxisStyle( - isMultiLayerTimeAxis: boolean, - darkMode: boolean, - ticks?: TickOptions, - title?: string, - rotationFallback: LabelRotation = LabelRotation.Vertical -): AxisSpec['style'] { - return isMultiLayerTimeAxis - ? { - ...MULTILAYER_TIME_AXIS_STYLE, - tickLabel: { - ...MULTILAYER_TIME_AXIS_STYLE.tickLabel, - visible: Boolean(ticks?.show), - }, - tickLine: { - ...MULTILAYER_TIME_AXIS_STYLE.tickLine, - visible: Boolean(ticks?.show), - }, - axisTitle: { - visible: (title ?? '').trim().length > 0, - }, - } - : { - axisTitle: { - visible: (title ?? '').trim().length > 0, - }, - tickLabel: { - visible: Boolean(ticks?.show), - rotation: -(ticks?.rotation ?? rotationFallback), - }, - }; -} - -function getAxisDomain( - scale: ScaleConfig, - isCategoryAxis: boolean -): YDomainRange | undefined { - if (isCategoryAxis || !scale) { - return; - } - - const { min, max, defaultYExtents, boundsMargin } = scale; - const fit = defaultYExtents; - const padding = boundsMargin || undefined; - - return { fit, padding, min: min ?? NaN, max: max ?? NaN }; -} diff --git a/src/plugins/vis_types/xy/public/config/get_config.test.ts b/src/plugins/vis_types/xy/public/config/get_config.test.ts deleted file mode 100644 index 7608ef7cda460..0000000000000 --- a/src/plugins/vis_types/xy/public/config/get_config.test.ts +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { getConfig } from './get_config'; -import { visData, visDataPercentile, visParamsWithTwoYAxes } from '../mocks'; -import { VisParams } from '../types'; - -// ToDo: add more tests for all the config properties -describe('getConfig', () => { - it('identifies it as a timeChart if the x axis has a date field', () => { - const config = getConfig(visData, visParamsWithTwoYAxes); - expect(config.isTimeChart).toBe(true); - }); - - it('not adds the current time marker if the param is set to false', () => { - const config = getConfig(visData, visParamsWithTwoYAxes); - expect(config.showCurrentTime).toBe(false); - }); - - it('adds the current time marker if the param is set to false', () => { - const newVisParams = { - ...visParamsWithTwoYAxes, - addTimeMarker: true, - }; - const config = getConfig(visData, newVisParams); - expect(config.showCurrentTime).toBe(true); - }); - - it('enables the histogram mode for a date_histogram', () => { - const config = getConfig(visData, visParamsWithTwoYAxes); - expect(config.enableHistogramMode).toBe(true); - }); - - it('assigns the correct formatter per y axis', () => { - const config = getConfig(visData, visParamsWithTwoYAxes); - expect(config.yAxes.length).toBe(2); - expect(config.yAxes[0].ticks?.formatter).toStrictEqual(config.aspects.y[0].formatter); - expect(config.yAxes[1].ticks?.formatter).toStrictEqual(config.aspects.y[1].formatter); - }); - - it('assigns the correct number of yAxes if the agg is hidden', () => { - // We have two axes but the one y dimension is hidden - const newVisParams = { - ...visParamsWithTwoYAxes, - dimensions: { - ...visParamsWithTwoYAxes.dimensions, - y: [ - { - label: 'Average memory', - aggType: 'avg', - params: {}, - accessor: 1, - format: { - id: 'number', - params: {}, - }, - }, - ], - }, - }; - const config = getConfig(visData, newVisParams); - expect(config.yAxes.length).toBe(1); - }); - - it('assigns the correct number of yAxes if the agg is Percentile', () => { - const newVisParams = { - ...visParamsWithTwoYAxes, - seriesParams: [ - { - type: 'line', - data: { - label: 'Percentiles of bytes', - id: '1', - }, - drawLinesBetweenPoints: true, - interpolate: 'linear', - lineWidth: 2, - mode: 'normal', - show: true, - showCircles: true, - circlesRadius: 3, - valueAxis: 'ValueAxis-1', - }, - ], - dimensions: { - ...visParamsWithTwoYAxes.dimensions, - y: ['1st', '5th', '25th', '50th', '75th', '95th', '99th'].map((prefix, accessor) => ({ - label: `${prefix} percentile of bytes`, - aggType: 'percentiles', - params: {}, - accessor, - format: { - id: 'number', - params: {}, - }, - })), - }, - } as VisParams; - const config = getConfig(visDataPercentile, newVisParams); - expect(config.yAxes.length).toBe(1); - }); -}); diff --git a/src/plugins/vis_types/xy/public/config/get_config.ts b/src/plugins/vis_types/xy/public/config/get_config.ts deleted file mode 100644 index 1a78b65f19f33..0000000000000 --- a/src/plugins/vis_types/xy/public/config/get_config.ts +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Fit, ScaleContinuousType } from '@elastic/charts'; - -import { Datatable } from '@kbn/expressions-plugin/public'; -import { BUCKET_TYPES } from '@kbn/data-plugin/public'; -import { DateHistogramParams } from '@kbn/visualizations-plugin/public'; - -import { - Aspect, - AxisConfig, - SeriesParam, - VisConfig, - VisParams, - XScaleType, - YScaleType, -} from '../types'; -import { getThresholdLine } from './get_threshold_line'; -import { getRotation } from './get_rotation'; -import { getTooltip } from './get_tooltip'; -import { getLegend } from './get_legend'; -import { getAxis } from './get_axis'; -import { getAspects } from './get_aspects'; -import { ChartType } from '..'; -import { getSafeId } from '../utils/accessors'; - -export function getConfig( - table: Datatable, - params: VisParams, - useLegacyTimeAxis = false, - darkMode = false -): VisConfig { - const { - thresholdLine, - orderBucketsBySum, - addTimeMarker, - radiusRatio, - labels, - fittingFunction, - detailedTooltip, - isVislibVis, - fillOpacity, - } = params; - const aspects = getAspects(table.columns, params.dimensions); - const tooltip = getTooltip(aspects, params); - - const yAxes: Array> = []; - - // avoid duplicates based on aggId - const aspectVisited = new Set(); - params.dimensions.y.forEach((y) => { - const accessor = y.accessor; - const aspect = aspects.y.find(({ column }) => column === accessor); - const aggId = getSafeId(aspect?.aggId); - const serie = params.seriesParams.find(({ data: { id } }) => id === aggId); - const valueAxis = params.valueAxes.find(({ id }) => id === serie?.valueAxis); - if (aspect && valueAxis && !aspectVisited.has(aggId)) { - yAxes.push(getAxis(valueAxis, params.grid, aspect, params.seriesParams)); - aspectVisited.add(aggId); - } - }); - - const rotation = getRotation(params.categoryAxes[0]); - - const isDateHistogram = params.dimensions.x?.aggType === BUCKET_TYPES.DATE_HISTOGRAM; - const isHistogram = params.dimensions.x?.aggType === BUCKET_TYPES.HISTOGRAM; - const enableHistogramMode = - (isDateHistogram || isHistogram) && - shouldEnableHistogramMode(params.seriesParams, aspects.y, yAxes); - - const useMultiLayerTimeAxis = - enableHistogramMode && isDateHistogram && !useLegacyTimeAxis && rotation === 0; - - const xAxis = getAxis( - params.categoryAxes[0], - params.grid, - aspects.x, - params.seriesParams, - isDateHistogram, - useMultiLayerTimeAxis, - darkMode - ); - - const isTimeChart = (aspects.x.params as DateHistogramParams).date ?? false; - - return { - // NOTE: downscale ratio to match current vislib implementation - markSizeRatio: radiusRatio * 0.6, - fittingFunction: fittingFunction ?? Fit.Linear, - fillOpacity, - detailedTooltip, - orderBucketsBySum, - isTimeChart, - isVislibVis, - showCurrentTime: addTimeMarker && isTimeChart, - showValueLabel: labels.show ?? false, - enableHistogramMode, - tooltip, - aspects, - xAxis, - yAxes, - legend: getLegend(params), - rotation, - thresholdLine: getThresholdLine(thresholdLine, yAxes, params.seriesParams), - }; -} - -/** - * disables histogram mode for any config that has non-stacked clustered bars - * - * @param seriesParams - * @param yAspects - * @param yAxes - */ -const shouldEnableHistogramMode = ( - seriesParams: SeriesParam[], - yAspects: Aspect[], - yAxes: Array> -): boolean => { - const bars = seriesParams.filter(({ type, data: { id: paramId } }) => { - return ( - type === ChartType.Histogram && yAspects.find(({ aggId }) => aggId === paramId) !== undefined - ); - }); - - const groupIds = [ - ...bars.reduce>((acc, { valueAxis: groupId, mode }) => { - acc.add(groupId); - return acc; - }, new Set()), - ]; - - if (groupIds.length > 1) { - return false; - } - - return bars.every(({ valueAxis: groupId, mode }) => { - return mode === 'stacked'; - }); -}; diff --git a/src/plugins/vis_types/xy/public/config/get_legend.ts b/src/plugins/vis_types/xy/public/config/get_legend.ts deleted file mode 100644 index 9a1c9e4bc9c58..0000000000000 --- a/src/plugins/vis_types/xy/public/config/get_legend.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 { LegendOptions, VisParams } from '../types'; - -export function getLegend({ addLegend, legendPosition }: VisParams): LegendOptions { - return { - show: addLegend, - position: legendPosition, - }; -} diff --git a/src/plugins/vis_types/xy/public/config/get_rotation.ts b/src/plugins/vis_types/xy/public/config/get_rotation.ts deleted file mode 100644 index 44c6a46357eb1..0000000000000 --- a/src/plugins/vis_types/xy/public/config/get_rotation.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Rotation } from '@elastic/charts'; - -import { CategoryAxis } from '../types'; - -export function getRotation({ position }: CategoryAxis): Rotation { - if (position === 'left' || position === 'right') { - return 90; - } - - return 0; -} diff --git a/src/plugins/vis_types/xy/public/config/get_threshold_line.ts b/src/plugins/vis_types/xy/public/config/get_threshold_line.ts deleted file mode 100644 index 64eb7e5e24a80..0000000000000 --- a/src/plugins/vis_types/xy/public/config/get_threshold_line.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 { - ThresholdLineConfig, - ThresholdLine, - ThresholdLineStyle, - AxisConfig, - SeriesParam, - YScaleType, -} from '../types'; - -export function getThresholdLine( - { style, ...rest }: ThresholdLine, - yAxes: Array>, - seriesParams: SeriesParam[] -): ThresholdLineConfig { - const groupId = yAxes.find(({ id }) => - seriesParams.some(({ valueAxis }) => id === valueAxis) - )?.groupId; - - return { - ...rest, - dash: getDash(style), - groupId, - }; -} - -function getDash(style: ThresholdLineStyle): number[] | undefined { - switch (style) { - case ThresholdLineStyle.Dashed: - return [10, 5]; - case ThresholdLineStyle.DotDashed: - return [20, 5, 5, 5]; - case ThresholdLineStyle.Full: - default: - return; - } -} diff --git a/src/plugins/vis_types/xy/public/config/get_tooltip.ts b/src/plugins/vis_types/xy/public/config/get_tooltip.ts deleted file mode 100644 index 69961cbed7699..0000000000000 --- a/src/plugins/vis_types/xy/public/config/get_tooltip.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. - */ - -import { TooltipType } from '@elastic/charts'; - -import { Aspects, VisParams, TooltipConfig } from '../types'; -import { getDetailedTooltip } from '../components/detailed_tooltip'; - -export function getTooltip( - aspects: Aspects, - { addTooltip, detailedTooltip }: VisParams -): TooltipConfig { - return { - type: addTooltip ? TooltipType.VerticalCursor : TooltipType.None, - detailedTooltip: detailedTooltip ? getDetailedTooltip(aspects) : undefined, - }; -} diff --git a/src/plugins/vis_types/xy/public/expression_functions/category_axis.ts b/src/plugins/vis_types/xy/public/expression_functions/category_axis.ts deleted file mode 100644 index 5283a54e57f30..0000000000000 --- a/src/plugins/vis_types/xy/public/expression_functions/category_axis.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { i18n } from '@kbn/i18n'; -import type { - ExpressionFunctionDefinition, - Datatable, - ExpressionValueBoxed, -} from '@kbn/expressions-plugin/public'; -import type { CategoryAxis } from '../types'; -import type { ExpressionValueScale } from './vis_scale'; -import type { ExpressionValueLabel } from './label'; - -export interface Arguments extends Omit { - title?: string; - scale: ExpressionValueScale; - labels: ExpressionValueLabel; -} - -export type ExpressionValueCategoryAxis = ExpressionValueBoxed< - 'category_axis', - { - id: CategoryAxis['id']; - show: CategoryAxis['show']; - position: CategoryAxis['position']; - axisType: CategoryAxis['type']; - title: { - text?: string; - }; - labels: CategoryAxis['labels']; - scale: CategoryAxis['scale']; - } ->; - -export const categoryAxis = (): ExpressionFunctionDefinition< - 'categoryaxis', - Datatable | null, - Arguments, - ExpressionValueCategoryAxis -> => ({ - name: 'categoryaxis', - help: i18n.translate('visTypeXy.function.categoryAxis.help', { - defaultMessage: 'Generates category axis object', - }), - type: 'category_axis', - args: { - id: { - types: ['string'], - help: i18n.translate('visTypeXy.function.categoryAxis.id.help', { - defaultMessage: 'Id of category axis', - }), - required: true, - }, - show: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.categoryAxis.show.help', { - defaultMessage: 'Show the category axis', - }), - required: true, - }, - position: { - types: ['string'], - help: i18n.translate('visTypeXy.function.categoryAxis.position.help', { - defaultMessage: 'Position of the category axis', - }), - required: true, - }, - type: { - types: ['string'], - help: i18n.translate('visTypeXy.function.categoryAxis.type.help', { - defaultMessage: 'Type of the category axis. Can be category or value', - }), - required: true, - }, - title: { - types: ['string'], - help: i18n.translate('visTypeXy.function.categoryAxis.title.help', { - defaultMessage: 'Title of the category axis', - }), - }, - scale: { - types: ['vis_scale'], - help: i18n.translate('visTypeXy.function.categoryAxis.scale.help', { - defaultMessage: 'Scale config', - }), - }, - labels: { - types: ['label'], - help: i18n.translate('visTypeXy.function.categoryAxis.labels.help', { - defaultMessage: 'Axis label config', - }), - }, - }, - fn: (context, args) => { - return { - type: 'category_axis', - id: args.id, - show: args.show, - position: args.position, - axisType: args.type, - title: { - text: args.title, - }, - scale: { - ...args.scale, - type: args.scale.scaleType, - }, - labels: args.labels, - }; - }, -}); diff --git a/src/plugins/vis_types/xy/public/expression_functions/index.ts b/src/plugins/vis_types/xy/public/expression_functions/index.ts deleted file mode 100644 index 4d6b2305a3651..0000000000000 --- a/src/plugins/vis_types/xy/public/expression_functions/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may 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 { visTypeXyVisFn } from './xy_vis_fn'; - -export type { ExpressionValueCategoryAxis } from './category_axis'; -export { categoryAxis } from './category_axis'; -export type { ExpressionValueTimeMarker } from './time_marker'; -export { timeMarker } from './time_marker'; -export type { ExpressionValueValueAxis } from './value_axis'; -export { valueAxis } from './value_axis'; -export type { ExpressionValueSeriesParam } from './series_param'; -export { seriesParam } from './series_param'; -export type { ExpressionValueThresholdLine } from './threshold_line'; -export { thresholdLine } from './threshold_line'; -export type { ExpressionValueLabel } from './label'; -export { label } from './label'; -export type { ExpressionValueScale } from './vis_scale'; -export { visScale } from './vis_scale'; diff --git a/src/plugins/vis_types/xy/public/expression_functions/label.ts b/src/plugins/vis_types/xy/public/expression_functions/label.ts deleted file mode 100644 index cd3eea2b68bc7..0000000000000 --- a/src/plugins/vis_types/xy/public/expression_functions/label.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 type { Labels } from '@kbn/charts-plugin/public'; -import type { - ExpressionFunctionDefinition, - Datatable, - ExpressionValueBoxed, -} from '@kbn/expressions-plugin/public'; - -export type ExpressionValueLabel = ExpressionValueBoxed< - 'label', - { - color?: Labels['color']; - filter?: Labels['filter']; - overwriteColor?: Labels['overwriteColor']; - rotate?: Labels['rotate']; - show?: Labels['show']; - truncate?: Labels['truncate']; - } ->; - -export const label = (): ExpressionFunctionDefinition< - 'label', - Datatable | null, - Labels, - ExpressionValueLabel -> => ({ - name: 'label', - help: i18n.translate('visTypeXy.function.label.help', { - defaultMessage: 'Generates label object', - }), - type: 'label', - args: { - color: { - types: ['string'], - help: i18n.translate('visTypeXy.function.label.color.help', { - defaultMessage: 'Color of label', - }), - }, - filter: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.label.filter.help', { - defaultMessage: 'Hides overlapping labels and duplicates on axis', - }), - }, - overwriteColor: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.label.overwriteColor.help', { - defaultMessage: 'Overwrite color', - }), - }, - rotate: { - types: ['number'], - help: i18n.translate('visTypeXy.function.label.rotate.help', { - defaultMessage: 'Rotate angle', - }), - }, - show: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.label.show.help', { - defaultMessage: 'Show label', - }), - }, - truncate: { - types: ['number', 'null'], - help: i18n.translate('visTypeXy.function.label.truncate.help', { - defaultMessage: 'The number of symbols before truncating', - }), - }, - }, - fn: (context, args) => { - return { - type: 'label', - color: args.color, - filter: args.hasOwnProperty('filter') ? args.filter : undefined, - overwriteColor: args.overwriteColor, - rotate: args.rotate, - show: args.show, - truncate: args.truncate, - }; - }, -}); diff --git a/src/plugins/vis_types/xy/public/expression_functions/series_param.ts b/src/plugins/vis_types/xy/public/expression_functions/series_param.ts deleted file mode 100644 index df5ed2ec0d9b4..0000000000000 --- a/src/plugins/vis_types/xy/public/expression_functions/series_param.ts +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { - ExpressionFunctionDefinition, - Datatable, - ExpressionValueBoxed, -} from '@kbn/expressions-plugin/public'; -import type { SeriesParam } from '../types'; - -export interface Arguments extends Omit { - label: string; - id: string; -} - -export type ExpressionValueSeriesParam = ExpressionValueBoxed< - 'series_param', - { - data: { label: string; id: string }; - drawLinesBetweenPoints?: boolean; - interpolate?: SeriesParam['interpolate']; - lineWidth?: number; - mode: SeriesParam['mode']; - show: boolean; - showCircles: boolean; - circlesRadius: number; - seriesParamType: SeriesParam['type']; - valueAxis: string; - } ->; - -export const seriesParam = (): ExpressionFunctionDefinition< - 'seriesparam', - Datatable, - Arguments, - ExpressionValueSeriesParam -> => ({ - name: 'seriesparam', - help: i18n.translate('visTypeXy.function.seriesparam.help', { - defaultMessage: 'Generates series param object', - }), - type: 'series_param', - inputTypes: ['datatable'], - args: { - label: { - types: ['string'], - help: i18n.translate('visTypeXy.function.seriesParam.label.help', { - defaultMessage: 'Name of series param', - }), - required: true, - }, - id: { - types: ['string'], - help: i18n.translate('visTypeXy.function.seriesParam.id.help', { - defaultMessage: 'Id of series param', - }), - required: true, - }, - drawLinesBetweenPoints: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.seriesParam.drawLinesBetweenPoints.help', { - defaultMessage: 'Draw lines between points', - }), - }, - interpolate: { - types: ['string'], - help: i18n.translate('visTypeXy.function.seriesParam.interpolate.help', { - defaultMessage: 'Interpolate mode. Can be linear, cardinal or step-after', - }), - }, - show: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.seriesParam.show.help', { - defaultMessage: 'Show param', - }), - required: true, - }, - lineWidth: { - types: ['number'], - help: i18n.translate('visTypeXy.function.seriesParam.lineWidth.help', { - defaultMessage: 'Width of line', - }), - }, - mode: { - types: ['string'], - help: i18n.translate('visTypeXy.function.seriesParam.mode.help', { - defaultMessage: 'Chart mode. Can be stacked or percentage', - }), - }, - showCircles: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.seriesParam.showCircles.help', { - defaultMessage: 'Show circles', - }), - }, - circlesRadius: { - types: ['number'], - help: i18n.translate('visTypeXy.function.seriesParam.circlesRadius.help', { - defaultMessage: 'Defines the circles size (radius)', - }), - }, - type: { - types: ['string'], - help: i18n.translate('visTypeXy.function.seriesParam.type.help', { - defaultMessage: 'Chart type. Can be line, area or histogram', - }), - }, - valueAxis: { - types: ['string'], - help: i18n.translate('visTypeXy.function.seriesParam.valueAxis.help', { - defaultMessage: 'Name of value axis', - }), - }, - }, - fn: (context, args) => { - return { - type: 'series_param', - data: { label: args.label, id: args.id }, - drawLinesBetweenPoints: args.drawLinesBetweenPoints, - interpolate: args.interpolate, - lineWidth: args.lineWidth, - mode: args.mode, - show: args.show, - showCircles: args.showCircles, - circlesRadius: args.circlesRadius, - seriesParamType: args.type, - valueAxis: args.valueAxis, - }; - }, -}); diff --git a/src/plugins/vis_types/xy/public/expression_functions/threshold_line.ts b/src/plugins/vis_types/xy/public/expression_functions/threshold_line.ts deleted file mode 100644 index 9a496158bf5a7..0000000000000 --- a/src/plugins/vis_types/xy/public/expression_functions/threshold_line.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 type { - ExpressionFunctionDefinition, - Datatable, - ExpressionValueBoxed, -} from '@kbn/expressions-plugin/public'; -import type { ThresholdLine } from '../types'; - -export type ExpressionValueThresholdLine = ExpressionValueBoxed< - 'threshold_line', - { - show: ThresholdLine['show']; - value: ThresholdLine['value']; - width: ThresholdLine['width']; - style: ThresholdLine['style']; - color: ThresholdLine['color']; - } ->; - -export const thresholdLine = (): ExpressionFunctionDefinition< - 'thresholdline', - Datatable | null, - ThresholdLine, - ExpressionValueThresholdLine -> => ({ - name: 'thresholdline', - help: i18n.translate('visTypeXy.function.thresholdLine.help', { - defaultMessage: 'Generates threshold line object', - }), - type: 'threshold_line', - args: { - show: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.thresholdLine.show.help', { - defaultMessage: 'Show threshould line', - }), - required: true, - }, - value: { - types: ['number', 'null'], - help: i18n.translate('visTypeXy.function.thresholdLine.value.help', { - defaultMessage: 'Threshold value', - }), - required: true, - }, - width: { - types: ['number', 'null'], - help: i18n.translate('visTypeXy.function.thresholdLine.width.help', { - defaultMessage: 'Width of threshold line', - }), - required: true, - }, - style: { - types: ['string'], - help: i18n.translate('visTypeXy.function.thresholdLine.style.help', { - defaultMessage: 'Style of threshold line. Can be full, dashed or dot-dashed', - }), - required: true, - }, - color: { - types: ['string'], - help: i18n.translate('visTypeXy.function.thresholdLine.color.help', { - defaultMessage: 'Color of threshold line', - }), - required: true, - }, - }, - fn: (context, args) => { - return { - type: 'threshold_line', - show: args.show, - value: args.value, - width: args.width, - style: args.style, - color: args.color, - }; - }, -}); diff --git a/src/plugins/vis_types/xy/public/expression_functions/time_marker.ts b/src/plugins/vis_types/xy/public/expression_functions/time_marker.ts deleted file mode 100644 index f3b8e9cdc61d0..0000000000000 --- a/src/plugins/vis_types/xy/public/expression_functions/time_marker.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { - ExpressionFunctionDefinition, - Datatable, - ExpressionValueBoxed, -} from '@kbn/expressions-plugin/public'; -import type { TimeMarker } from '../types'; - -export type ExpressionValueTimeMarker = ExpressionValueBoxed< - 'time_marker', - { - time: string; - class?: string; - color?: string; - opacity?: number; - width?: number; - } ->; - -export const timeMarker = (): ExpressionFunctionDefinition< - 'timemarker', - Datatable | null, - TimeMarker, - ExpressionValueTimeMarker -> => ({ - name: 'timemarker', - help: i18n.translate('visTypeXy.function.timemarker.help', { - defaultMessage: 'Generates time marker object', - }), - type: 'time_marker', - args: { - time: { - types: ['string'], - help: i18n.translate('visTypeXy.function.timeMarker.time.help', { - defaultMessage: 'Exact Time', - }), - required: true, - }, - class: { - types: ['string'], - help: i18n.translate('visTypeXy.function.timeMarker.class.help', { - defaultMessage: 'Css class name', - }), - }, - color: { - types: ['string'], - help: i18n.translate('visTypeXy.function.timeMarker.color.help', { - defaultMessage: 'Color of time marker', - }), - }, - opacity: { - types: ['number'], - help: i18n.translate('visTypeXy.function.timeMarker.opacity.help', { - defaultMessage: 'Opacity of time marker', - }), - }, - width: { - types: ['number'], - help: i18n.translate('visTypeXy.function.timeMarker.width.help', { - defaultMessage: 'Width of time marker', - }), - }, - }, - fn: (context, args) => { - return { - type: 'time_marker', - time: args.time, - class: args.class, - color: args.color, - opacity: args.opacity, - width: args.width, - }; - }, -}); diff --git a/src/plugins/vis_types/xy/public/expression_functions/value_axis.ts b/src/plugins/vis_types/xy/public/expression_functions/value_axis.ts deleted file mode 100644 index 8b32084d8b588..0000000000000 --- a/src/plugins/vis_types/xy/public/expression_functions/value_axis.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { - ExpressionFunctionDefinition, - Datatable, - ExpressionValueBoxed, -} from '@kbn/expressions-plugin/public'; -import type { ExpressionValueCategoryAxis } from './category_axis'; -import type { CategoryAxis } from '../types'; - -interface Arguments { - name: string; - axisParams: ExpressionValueCategoryAxis; -} - -export type ExpressionValueValueAxis = ExpressionValueBoxed< - 'value_axis', - { - name: string; - id: string; - show: boolean; - position: CategoryAxis['position']; - axisType: CategoryAxis['type']; - title: { - text?: string; - }; - labels: CategoryAxis['labels']; - scale: CategoryAxis['scale']; - } ->; - -export const valueAxis = (): ExpressionFunctionDefinition< - 'valueaxis', - Datatable | null, - Arguments, - ExpressionValueValueAxis -> => ({ - name: 'valueaxis', - help: i18n.translate('visTypeXy.function.valueaxis.help', { - defaultMessage: 'Generates value axis object', - }), - type: 'value_axis', - args: { - name: { - types: ['string'], - help: i18n.translate('visTypeXy.function.valueAxis.name.help', { - defaultMessage: 'Name of value axis', - }), - required: true, - }, - axisParams: { - types: ['category_axis'], - help: i18n.translate('visTypeXy.function.valueAxis.axisParams.help', { - defaultMessage: 'Value axis params', - }), - required: true, - }, - }, - fn: (context, args) => { - return { - type: 'value_axis', - name: args.name, - id: args.axisParams.id, - show: args.axisParams.show, - position: args.axisParams.position, - axisType: args.axisParams.axisType, - title: args.axisParams.title, - scale: args.axisParams.scale, - labels: args.axisParams.labels, - }; - }, -}); diff --git a/src/plugins/vis_types/xy/public/expression_functions/vis_scale.ts b/src/plugins/vis_types/xy/public/expression_functions/vis_scale.ts deleted file mode 100644 index 33952473e5916..0000000000000 --- a/src/plugins/vis_types/xy/public/expression_functions/vis_scale.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { - ExpressionFunctionDefinition, - Datatable, - ExpressionValueBoxed, -} from '@kbn/expressions-plugin/public'; -import type { Scale } from '../types'; - -export type ExpressionValueScale = ExpressionValueBoxed< - 'vis_scale', - { - boundsMargin?: Scale['boundsMargin']; - defaultYExtents?: Scale['defaultYExtents']; - max?: Scale['max']; - min?: Scale['min']; - mode?: Scale['mode']; - setYExtents?: Scale['setYExtents']; - scaleType: Scale['type']; - } ->; - -export const visScale = (): ExpressionFunctionDefinition< - 'visscale', - Datatable | null, - Scale, - ExpressionValueScale -> => ({ - name: 'visscale', - help: i18n.translate('visTypeXy.function.scale.help', { - defaultMessage: 'Generates scale object', - }), - type: 'vis_scale', - args: { - boundsMargin: { - types: ['number', 'string'], - help: i18n.translate('visTypeXy.function.scale.boundsMargin.help', { - defaultMessage: 'Margin of bounds', - }), - }, - defaultYExtents: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.scale.defaultYExtents.help', { - defaultMessage: 'Flag which allows to scale to data bounds', - }), - }, - setYExtents: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.scale.setYExtents.help', { - defaultMessage: 'Flag which allows to set your own extents', - }), - }, - max: { - types: ['number', 'null'], - help: i18n.translate('visTypeXy.function.scale.max.help', { - defaultMessage: 'Max value', - }), - }, - min: { - types: ['number', 'null'], - help: i18n.translate('visTypeXy.function.scale.min.help', { - defaultMessage: 'Min value', - }), - }, - mode: { - types: ['string'], - help: i18n.translate('visTypeXy.function.scale.mode.help', { - defaultMessage: 'Scale mode. Can be normal, percentage, wiggle or silhouette', - }), - }, - type: { - types: ['string'], - help: i18n.translate('visTypeXy.function.scale.type.help', { - defaultMessage: 'Scale type. Can be linear, log or square root', - }), - required: true, - }, - }, - fn: (context, args) => { - return { - type: 'vis_scale', - boundsMargin: args.boundsMargin, - defaultYExtents: args.defaultYExtents, - setYExtents: args.setYExtents, - max: args.max, - min: args.min, - mode: args.mode, - scaleType: args.type, - }; - }, -}); diff --git a/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts b/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts deleted file mode 100644 index 8dc7481300bc0..0000000000000 --- a/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { - ExpressionFunctionDefinition, - Datatable, - Render, -} from '@kbn/expressions-plugin/common'; -import { - prepareLogTable, - Dimension, - DEFAULT_LEGEND_SIZE, - LegendSize, -} from '@kbn/visualizations-plugin/public'; -import type { VisParams, XYVisConfig } from '../types'; -import type { XyVisType } from '../../common'; - -export const visName = 'xy_vis'; -export interface RenderValue { - visData: Datatable; - visType: XyVisType; - visConfig: VisParams; - syncColors: boolean; - syncTooltips: boolean; -} - -export type VisTypeXyExpressionFunctionDefinition = ExpressionFunctionDefinition< - typeof visName, - Datatable, - XYVisConfig, - Render ->; - -export const visTypeXyVisFn = (): VisTypeXyExpressionFunctionDefinition => ({ - name: visName, - type: 'render', - context: { - types: ['datatable'], - }, - help: i18n.translate('visTypeXy.functions.help', { - defaultMessage: 'XY visualization', - }), - args: { - type: { - types: ['string'], - default: '""', - help: 'xy vis type', - }, - chartType: { - types: ['string'], - help: i18n.translate('visTypeXy.function.args.args.chartType.help', { - defaultMessage: 'Type of a chart. Can be line, area or histogram', - }), - }, - addTimeMarker: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.args.addTimeMarker.help', { - defaultMessage: 'Show time marker', - }), - }, - truncateLegend: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.args.truncateLegend.help', { - defaultMessage: 'Defines if the legend will be truncated or not', - }), - }, - maxLegendLines: { - types: ['number'], - help: i18n.translate('visTypeXy.function.args.args.maxLegendLines.help', { - defaultMessage: 'Defines the maximum lines per legend item', - }), - }, - legendSize: { - types: ['string'], - default: DEFAULT_LEGEND_SIZE, - help: i18n.translate('visTypeXy.function.args.args.legendSize.help', { - defaultMessage: 'Specifies the legend size.', - }), - options: [ - LegendSize.AUTO, - LegendSize.SMALL, - LegendSize.MEDIUM, - LegendSize.LARGE, - LegendSize.EXTRA_LARGE, - ], - strict: true, - }, - addLegend: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.args.addLegend.help', { - defaultMessage: 'Show chart legend', - }), - }, - addTooltip: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.args.addTooltip.help', { - defaultMessage: 'Show tooltip on hover', - }), - }, - legendPosition: { - types: ['string'], - help: i18n.translate('visTypeXy.function.args.legendPosition.help', { - defaultMessage: 'Position the legend on top, bottom, left, right of the chart', - }), - }, - categoryAxes: { - types: ['category_axis'], - help: i18n.translate('visTypeXy.function.args.categoryAxes.help', { - defaultMessage: 'Category axis config', - }), - multi: true, - }, - thresholdLine: { - types: ['threshold_line'], - help: i18n.translate('visTypeXy.function.args.thresholdLine.help', { - defaultMessage: 'Threshold line config', - }), - }, - labels: { - types: ['label'], - help: i18n.translate('visTypeXy.function.args.labels.help', { - defaultMessage: 'Chart labels config', - }), - }, - orderBucketsBySum: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.args.orderBucketsBySum.help', { - defaultMessage: 'Order buckets by sum', - }), - }, - seriesParams: { - types: ['series_param'], - help: i18n.translate('visTypeXy.function.args.seriesParams.help', { - defaultMessage: 'Series param config', - }), - multi: true, - }, - valueAxes: { - types: ['value_axis'], - help: i18n.translate('visTypeXy.function.args.valueAxes.help', { - defaultMessage: 'Value axis config', - }), - multi: true, - }, - radiusRatio: { - types: ['number'], - help: i18n.translate('visTypeXy.function.args.radiusRatio.help', { - defaultMessage: 'Dot size ratio', - }), - }, - gridCategoryLines: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.args.gridCategoryLines.help', { - defaultMessage: 'Show grid category lines in chart', - }), - }, - gridValueAxis: { - types: ['string'], - help: i18n.translate('visTypeXy.function.args.gridValueAxis.help', { - defaultMessage: 'Name of value axis for which we show grid', - }), - }, - isVislibVis: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.args.isVislibVis.help', { - defaultMessage: - 'Flag to indicate old vislib visualizations. Used for backwards compatibility including colors', - }), - }, - detailedTooltip: { - types: ['boolean'], - help: i18n.translate('visTypeXy.function.args.detailedTooltip.help', { - defaultMessage: 'Show detailed tooltip', - }), - }, - fittingFunction: { - types: ['string'], - help: i18n.translate('visTypeXy.function.args.fittingFunction.help', { - defaultMessage: 'Name of fitting function', - }), - }, - times: { - types: ['time_marker'], - help: i18n.translate('visTypeXy.function.args.times.help', { - defaultMessage: 'Time marker config', - }), - multi: true, - }, - palette: { - types: ['string'], - help: i18n.translate('visTypeXy.function.args.palette.help', { - defaultMessage: 'Defines the chart palette name', - }), - }, - fillOpacity: { - types: ['number'], - help: i18n.translate('visTypeXy.function.args.fillOpacity.help', { - defaultMessage: 'Defines the area chart fill opacity', - }), - }, - xDimension: { - types: ['xy_dimension', 'null'], - help: i18n.translate('visTypeXy.function.args.xDimension.help', { - defaultMessage: 'X axis dimension config', - }), - }, - yDimension: { - types: ['xy_dimension'], - help: i18n.translate('visTypeXy.function.args.yDimension.help', { - defaultMessage: 'Y axis dimension config', - }), - multi: true, - }, - zDimension: { - types: ['xy_dimension'], - help: i18n.translate('visTypeXy.function.args.zDimension.help', { - defaultMessage: 'Z axis dimension config', - }), - multi: true, - }, - widthDimension: { - types: ['xy_dimension'], - help: i18n.translate('visTypeXy.function.args.widthDimension.help', { - defaultMessage: 'Width dimension config', - }), - multi: true, - }, - seriesDimension: { - types: ['xy_dimension'], - help: i18n.translate('visTypeXy.function.args.seriesDimension.help', { - defaultMessage: 'Series dimension config', - }), - multi: true, - }, - splitRowDimension: { - types: ['xy_dimension'], - help: i18n.translate('visTypeXy.function.args.splitRowDimension.help', { - defaultMessage: 'Split by row dimension config', - }), - multi: true, - }, - splitColumnDimension: { - types: ['xy_dimension'], - help: i18n.translate('visTypeXy.function.args.splitColumnDimension.help', { - defaultMessage: 'Split by column dimension config', - }), - multi: true, - }, - ariaLabel: { - types: ['string'], - help: i18n.translate('visTypeXy.function.args.ariaLabel.help', { - defaultMessage: 'Specifies the aria label of the xy chart', - }), - required: false, - }, - }, - fn(context, args, handlers) { - const visType = args.type; - const visConfig = { - ariaLabel: - args.ariaLabel ?? - (handlers.variables?.embeddableTitle as string) ?? - handlers.getExecutionContext?.()?.description, - type: args.chartType, - addLegend: args.addLegend, - addTooltip: args.addTooltip, - legendPosition: args.legendPosition, - addTimeMarker: args.addTimeMarker, - maxLegendLines: args.maxLegendLines, - truncateLegend: args.truncateLegend, - legendSize: args.legendSize, - categoryAxes: args.categoryAxes.map((categoryAxis) => ({ - ...categoryAxis, - type: categoryAxis.axisType, - })), - orderBucketsBySum: args.orderBucketsBySum, - labels: args.labels, - thresholdLine: args.thresholdLine, - valueAxes: args.valueAxes.map((valueAxis) => ({ ...valueAxis, type: valueAxis.axisType })), - grid: { - categoryLines: args.gridCategoryLines, - valueAxis: args.gridValueAxis, - }, - seriesParams: args.seriesParams.map((seriesParam) => ({ - ...seriesParam, - type: seriesParam.seriesParamType, - })), - radiusRatio: args.radiusRatio, - times: args.times, - isVislibVis: args.isVislibVis, - detailedTooltip: args.detailedTooltip, - palette: { - type: 'palette', - name: args.palette, - }, - fillOpacity: args.fillOpacity, - fittingFunction: args.fittingFunction, - dimensions: { - x: args.xDimension, - y: args.yDimension, - z: args.zDimension, - width: args.widthDimension, - series: args.seriesDimension, - splitRow: args.splitRowDimension, - splitColumn: args.splitColumnDimension, - }, - } as VisParams; - - if (handlers?.inspectorAdapters?.tables) { - const argsTable: Dimension[] = [ - [ - args.yDimension, - i18n.translate('visTypeXy.function.dimension.metric', { - defaultMessage: 'Metric', - }), - ], - [ - args.zDimension, - i18n.translate('visTypeXy.function.adimension.dotSize', { - defaultMessage: 'Dot size', - }), - ], - [ - args.splitColumnDimension, - i18n.translate('visTypeXy.function.dimension.splitcolumn', { - defaultMessage: 'Column split', - }), - ], - [ - args.splitRowDimension, - i18n.translate('visTypeXy.function.dimension.splitrow', { - defaultMessage: 'Row split', - }), - ], - ]; - - if (args.xDimension) { - argsTable.push([ - [args.xDimension], - i18n.translate('visTypeXy.function.adimension.bucket', { - defaultMessage: 'Bucket', - }), - ]); - } - - const logTable = prepareLogTable(context, argsTable); - handlers.inspectorAdapters.tables.logDatatable('default', logTable); - } - - return { - type: 'render', - as: visName, - value: { - context, - visType, - visConfig, - visData: context, - syncColors: handlers?.isSyncColorsEnabled?.() ?? false, - syncTooltips: handlers?.isSyncTooltipsEnabled?.() ?? false, - }, - }; - }, -}); diff --git a/src/plugins/vis_types/xy/public/index.ts b/src/plugins/vis_types/xy/public/index.ts index 41a8e08fa1ad2..7ad2e3058e49f 100644 --- a/src/plugins/vis_types/xy/public/index.ts +++ b/src/plugins/vis_types/xy/public/index.ts @@ -29,7 +29,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 { getAggId } from './config/get_agg_id'; // Export common types export * from '../common'; diff --git a/src/plugins/vis_types/xy/public/plugin.ts b/src/plugins/vis_types/xy/public/plugin.ts index 29a5e434a5f01..4561006e43e92 100644 --- a/src/plugins/vis_types/xy/public/plugin.ts +++ b/src/plugins/vis_types/xy/public/plugin.ts @@ -6,31 +6,12 @@ * Side Public License, v 1. */ -import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import type { Plugin as ExpressionsPublicPlugin } from '@kbn/expressions-plugin/public'; -import type { VisualizationsSetup, VisualizationsStart } from '@kbn/visualizations-plugin/public'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { ChartsPluginSetup, ChartsPluginStart } from '@kbn/charts-plugin/public'; -import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import type { - UsageCollectionSetup, - UsageCollectionStart, -} from '@kbn/usage-collection-plugin/public'; -import { createStartServicesGetter } from '@kbn/kibana-utils-plugin/public'; -import { - setDataActions, - setFormatService, - setThemeService, - setUISettings, - setDocLinks, - setPalettesService, - setActiveCursor, -} from './services'; +import type { CoreSetup, Plugin } from '@kbn/core/public'; +import type { VisualizationsSetup } from '@kbn/visualizations-plugin/public'; +import type { ChartsPluginSetup } from '@kbn/charts-plugin/public'; +import { setUISettings, setPalettesService } from './services'; import { visTypesDefinitions } from './vis_types'; -import { getXYVisRenderer } from './vis_renderer'; - -import * as expressionFunctions from './expression_functions'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface VisTypeXyPluginSetup {} @@ -39,70 +20,29 @@ export interface VisTypeXyPluginStart {} /** @internal */ export interface VisTypeXyPluginSetupDependencies { - expressions: ReturnType; visualizations: VisualizationsSetup; charts: ChartsPluginSetup; - usageCollection: UsageCollectionSetup; -} - -/** @internal */ -export interface VisTypeXyPluginStartDependencies { - expressions: ReturnType; - visualizations: VisualizationsStart; - data: DataPublicPluginStart; - fieldFormats: FieldFormatsStart; - charts: ChartsPluginStart; - usageCollection?: UsageCollectionStart; } -type VisTypeXyCoreSetup = CoreSetup; +type VisTypeXyCoreSetup = CoreSetup<{}, VisTypeXyPluginStart>; /** @internal */ export class VisTypeXyPlugin implements - Plugin< - VisTypeXyPluginSetup, - VisTypeXyPluginStart, - VisTypeXyPluginSetupDependencies, - VisTypeXyPluginStartDependencies - > + Plugin { public setup( core: VisTypeXyCoreSetup, - { expressions, visualizations, charts, usageCollection }: VisTypeXyPluginSetupDependencies + { visualizations, charts }: VisTypeXyPluginSetupDependencies ) { setUISettings(core.uiSettings); - setThemeService(charts.theme); setPalettesService(charts.palettes); - const getStartDeps = createStartServicesGetter< - VisTypeXyPluginStartDependencies, - VisTypeXyPluginStart - >(core.getStartServices); - - expressions.registerRenderer( - getXYVisRenderer({ - getStartDeps, - }) - ); - 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); return {}; } - public start(core: CoreStart, { data, charts, fieldFormats }: VisTypeXyPluginStartDependencies) { - setFormatService(fieldFormats); - setDataActions(data.actions); - setDocLinks(core.docLinks); - setActiveCursor(charts.activeCursor); + public start() { return {}; } } diff --git a/src/plugins/vis_types/xy/public/services.ts b/src/plugins/vis_types/xy/public/services.ts index d680a5d7f4498..2358bcb5ede2e 100644 --- a/src/plugins/vis_types/xy/public/services.ts +++ b/src/plugins/vis_types/xy/public/services.ts @@ -6,29 +6,13 @@ * Side Public License, v 1. */ -import type { CoreSetup, DocLinksStart } from '@kbn/core/public'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import type { ChartsPluginSetup, ChartsPluginStart } from '@kbn/charts-plugin/public'; +import type { CoreSetup } from '@kbn/core/public'; +import type { ChartsPluginSetup } from '@kbn/charts-plugin/public'; import { createGetterSetter } from '@kbn/kibana-utils-plugin/public'; export const [getUISettings, setUISettings] = createGetterSetter('xy core.uiSettings'); -export const [getDataActions, setDataActions] = - createGetterSetter('xy data.actions'); - -export const [getFormatService, setFormatService] = - createGetterSetter('xy fieldFormats'); - -export const [getThemeService, setThemeService] = - createGetterSetter('xy charts.theme'); - -export const [getActiveCursor, setActiveCursor] = - createGetterSetter('xy charts.activeCursor'); - export const [getPalettesService, setPalettesService] = createGetterSetter('xy charts.palette'); - -export const [getDocLinks, setDocLinks] = createGetterSetter('DocLinks'); diff --git a/src/plugins/vis_types/xy/public/types/config.ts b/src/plugins/vis_types/xy/public/types/config.ts deleted file mode 100644 index 287787193bd20..0000000000000 --- a/src/plugins/vis_types/xy/public/types/config.ts +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { - AxisSpec, - CustomTooltip, - Fit, - GridLineStyle, - Position, - Rotation, - SeriesScales, - TickFormatter, - TooltipProps, - TooltipValueFormatter, - YDomainRange, -} from '@elastic/charts'; - -import type { Dimension, Scale, ThresholdLine } from './param'; - -export interface Column { - id: string | null; - name: string; -} - -export interface Aspect { - accessor: Column['id']; - aggType: string | null; - aggId: string | null; - column?: Dimension['accessor']; - title: Column['name']; - format?: Dimension['format']; - formatter?: TickFormatter; - params: Dimension['params']; -} - -export interface Aspects { - x: Aspect; - y: Aspect[]; - z?: Aspect; - series?: Aspect[]; - splitColumn?: Aspect; - splitRow?: Aspect; -} - -export interface AxisGrid { - show?: boolean; - styles?: GridLineStyle; -} - -export interface TickOptions { - show?: boolean; - size?: number; - count?: number; - padding?: number; - formatter?: TickFormatter; - labelFormatter?: TickFormatter; - rotation?: number; - showDuplicates?: boolean; - integersOnly?: boolean; - showOverlappingTicks?: boolean; - showOverlappingLabels?: boolean; -} - -export type YScaleType = SeriesScales['yScaleType']; -export type XScaleType = SeriesScales['xScaleType']; - -export type ScaleConfig = Omit & { - type?: S; -}; - -export interface AxisConfig { - id: string; - groupId?: string; - position: Position; - ticks?: TickOptions; - show: boolean; - style: AxisSpec['style']; - scale: ScaleConfig; - domain?: YDomainRange; - title?: string; - grid?: AxisGrid; - integersOnly: boolean; - timeAxisLayerCount?: number; -} - -export interface LegendOptions { - show: boolean; - position?: Position; -} - -export type ThresholdLineConfig = Omit & { - dash?: number[]; - groupId?: string; -}; - -export type TooltipConfig = Omit & { - detailedTooltip?: (headerFormatter?: TooltipValueFormatter) => CustomTooltip; -}; - -export interface VisConfig { - legend: LegendOptions; - tooltip: TooltipConfig; - xAxis: AxisConfig; - yAxes: Array>; - aspects: Aspects; - rotation: Rotation; - thresholdLine: ThresholdLineConfig; - orderBucketsBySum?: boolean; - showCurrentTime: boolean; - isTimeChart: boolean; - markSizeRatio: number; - showValueLabel: boolean; - enableHistogramMode: boolean; - fittingFunction?: Exclude; - fillOpacity?: number; - detailedTooltip?: boolean; - isVislibVis?: boolean; -} diff --git a/src/plugins/vis_types/xy/public/types/constants.ts b/src/plugins/vis_types/xy/public/types/constants.ts index 05ed0783d4c68..e4c7c30dc2e89 100644 --- a/src/plugins/vis_types/xy/public/types/constants.ts +++ b/src/plugins/vis_types/xy/public/types/constants.ts @@ -40,9 +40,3 @@ export enum ThresholdLineStyle { Dashed = 'dashed', DotDashed = 'dot-dashed', } - -export enum ColorMode { - Background = 'Background', - Labels = 'Labels', - None = 'None', -} diff --git a/src/plugins/vis_types/xy/public/types/index.ts b/src/plugins/vis_types/xy/public/types/index.ts index 6abbdfabaa956..04426b03c5b87 100644 --- a/src/plugins/vis_types/xy/public/types/index.ts +++ b/src/plugins/vis_types/xy/public/types/index.ts @@ -7,6 +7,4 @@ */ export * from './constants'; -export * from './config'; export * from './param'; -export type { VisTypeNames, XyVisTypeDefinition } from './vis_type'; diff --git a/src/plugins/vis_types/xy/public/types/param.ts b/src/plugins/vis_types/xy/public/types/param.ts index a491efad97fcb..5e65c85e9f2e9 100644 --- a/src/plugins/vis_types/xy/public/types/param.ts +++ b/src/plugins/vis_types/xy/public/types/param.ts @@ -11,21 +11,12 @@ import type { PaletteOutput } from '@kbn/coloring'; import type { Style, Labels } from '@kbn/charts-plugin/public'; import type { SchemaConfig, - ExpressionValueXYDimension, FakeParams, HistogramParams, DateHistogramParams, LegendSize, } from '@kbn/visualizations-plugin/public'; -import type { ChartType, XyVisType } from '../../common'; -import type { - ExpressionValueCategoryAxis, - ExpressionValueSeriesParam, - ExpressionValueValueAxis, - ExpressionValueLabel, - ExpressionValueThresholdLine, - ExpressionValueTimeMarker, -} from '../expression_functions'; +import type { ChartType } from '../../common'; import type { ChartMode, @@ -150,45 +141,3 @@ export interface VisParams { fittingFunction?: Exclude; ariaLabel?: string; } - -export interface XYVisConfig { - type: XyVisType; - chartType: ChartType; - gridCategoryLines: boolean; - gridValueAxis?: string; - categoryAxes: ExpressionValueCategoryAxis[]; - valueAxes: ExpressionValueValueAxis[]; - seriesParams: ExpressionValueSeriesParam[]; - palette: string; - addLegend: boolean; - addTooltip: boolean; - legendPosition: Position; - addTimeMarker: boolean; - truncateLegend: boolean; - maxLegendLines: number; - legendSize?: LegendSize; - orderBucketsBySum?: boolean; - labels: ExpressionValueLabel; - thresholdLine: ExpressionValueThresholdLine; - radiusRatio: number; - times: ExpressionValueTimeMarker[]; // For compatibility with vislib - /** - * flag to indicate old vislib visualizations - * used for backwards compatibility including colors - */ - isVislibVis?: boolean; - /** - * Add for detailed tooltip option - */ - detailedTooltip?: boolean; - fittingFunction?: Exclude; - fillOpacity?: number; - xDimension: ExpressionValueXYDimension | null; - yDimension: ExpressionValueXYDimension[]; - zDimension?: ExpressionValueXYDimension[]; - widthDimension?: ExpressionValueXYDimension[]; - seriesDimension?: ExpressionValueXYDimension[]; - splitRowDimension?: ExpressionValueXYDimension[]; - splitColumnDimension?: ExpressionValueXYDimension[]; - ariaLabel?: string; -} diff --git a/src/plugins/vis_types/xy/public/types/vis_type.ts b/src/plugins/vis_types/xy/public/types/vis_type.ts deleted file mode 100644 index 39d762465c34f..0000000000000 --- a/src/plugins/vis_types/xy/public/types/vis_type.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 { VisTypeDefinition } from '@kbn/visualizations-plugin/public'; -import { ChartType } from '../../common'; - -import { VisParams } from './param'; - -export type VisTypeNames = ChartType | 'horizontal_bar'; - -export type XyVisTypeDefinition = VisTypeDefinition; diff --git a/src/plugins/vis_types/xy/public/utils/accessors.test.ts b/src/plugins/vis_types/xy/public/utils/accessors.test.ts deleted file mode 100644 index 882c3d382a237..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/accessors.test.ts +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { - COMPLEX_SPLIT_ACCESSOR, - getComplexAccessor, - isPercentileIdEqualToSeriesId, -} from './accessors'; -import { BUCKET_TYPES } from '@kbn/data-plugin/common'; -import { AccessorFn, Datum } from '@elastic/charts'; - -describe('XY chart datum accessors', () => { - const aspectBase = { - accessor: 'col-0-2', - formatter: (value: Datum) => value, - aggId: '', - title: '', - params: {}, - }; - - it('should return complex accessor for IP range aggregation', () => { - const aspect = { - aggType: BUCKET_TYPES.IP_RANGE, - ...aspectBase, - }; - const accessor = getComplexAccessor(COMPLEX_SPLIT_ACCESSOR)(aspect); - const datum = { - 'col-0-2': { type: 'range', from: '0.0.0.0', to: '127.255.255.255' }, - }; - - expect(typeof accessor).toBe('function'); - expect((accessor as AccessorFn)(datum)).toStrictEqual({ - type: 'range', - from: '0.0.0.0', - to: '127.255.255.255', - }); - }); - - it('should return complex accessor for date range aggregation', () => { - const aspect = { - aggType: BUCKET_TYPES.DATE_RANGE, - ...aspectBase, - }; - const accessor = getComplexAccessor(COMPLEX_SPLIT_ACCESSOR)(aspect); - const datum = { - 'col-0-2': { from: '1613941200000', to: '1614685113537' }, - }; - - expect(typeof accessor).toBe('function'); - expect((accessor as AccessorFn)(datum)).toStrictEqual({ - from: '1613941200000', - to: '1614685113537', - }); - }); - - it('should return complex accessor when isComplex option set to true', () => { - const aspect = { - aggType: BUCKET_TYPES.TERMS, - ...aspectBase, - }; - const accessor = getComplexAccessor(COMPLEX_SPLIT_ACCESSOR, true)(aspect); - - expect(typeof accessor).toBe('function'); - expect((accessor as AccessorFn)({ 'col-0-2': 'some value' })).toBe('some value'); - }); - - it('should return simple string accessor for not range (date histogram) aggregation', () => { - const aspect = { - aggType: BUCKET_TYPES.DATE_HISTOGRAM, - ...aspectBase, - }; - const accessor = getComplexAccessor(COMPLEX_SPLIT_ACCESSOR)(aspect); - - expect(typeof accessor).toBe('string'); - expect(accessor).toBe('col-0-2'); - }); - - it('should return simple string accessor when aspect has no formatter', () => { - const aspect = { - aggType: BUCKET_TYPES.RANGE, - ...aspectBase, - formatter: undefined, - }; - const accessor = getComplexAccessor(COMPLEX_SPLIT_ACCESSOR)(aspect); - - expect(typeof accessor).toBe('string'); - expect(accessor).toBe('col-0-2'); - }); - - it('should return undefined when aspect has no accessor', () => { - const aspect = { - aggType: BUCKET_TYPES.RANGE, - ...aspectBase, - accessor: null, - }; - const accessor = getComplexAccessor(COMPLEX_SPLIT_ACCESSOR)(aspect); - - expect(accessor).toBeUndefined(); - }); -}); - -describe('isPercentileIdEqualToSeriesId', () => { - it('should be equal for plain column ids', () => { - const seriesColumnId = 'col-0-1'; - const columnId = `${seriesColumnId}`; - - const isEqual = isPercentileIdEqualToSeriesId(columnId, seriesColumnId); - expect(isEqual).toBeTruthy(); - }); - - it('should be equal for column with percentile', () => { - const seriesColumnId = '1'; - const columnId = `${seriesColumnId}.95`; - - const isEqual = isPercentileIdEqualToSeriesId(columnId, seriesColumnId); - expect(isEqual).toBeTruthy(); - }); - - it('should not be equal for column with percentile equal to seriesColumnId', () => { - const seriesColumnId = '1'; - const columnId = `2.1`; - - const isEqual = isPercentileIdEqualToSeriesId(columnId, seriesColumnId); - expect(isEqual).toBeFalsy(); - }); - - it('should be equal for column with percentile with decimal points', () => { - const seriesColumnId = '1'; - const columnId = `${seriesColumnId}['95.5']`; - - const isEqual = isPercentileIdEqualToSeriesId(columnId, seriesColumnId); - expect(isEqual).toBeTruthy(); - }); - - it('should not be equal for column with percentile with decimal points equal to seriesColumnId', () => { - const seriesColumnId = '1'; - const columnId = `2['1.3']`; - - const isEqual = isPercentileIdEqualToSeriesId(columnId, seriesColumnId); - expect(isEqual).toBeFalsy(); - }); - - it('should not be equal for column with percentile, where columnId contains seriesColumnId', () => { - const seriesColumnId = '1'; - const columnId = `${seriesColumnId}2.1`; - - const isEqual = isPercentileIdEqualToSeriesId(columnId, seriesColumnId); - expect(isEqual).toBeFalsy(); - }); -}); diff --git a/src/plugins/vis_types/xy/public/utils/accessors.tsx b/src/plugins/vis_types/xy/public/utils/accessors.tsx index 9739a9d3328ea..40f87f8e78061 100644 --- a/src/plugins/vis_types/xy/public/utils/accessors.tsx +++ b/src/plugins/vis_types/xy/public/utils/accessors.tsx @@ -6,78 +6,6 @@ * Side Public License, v 1. */ -import { AccessorFn, Accessor } from '@elastic/charts'; -import { BUCKET_TYPES } from '@kbn/data-plugin/public'; -import { FakeParams } from '@kbn/visualizations-plugin/public'; -import type { 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 ( - getComplexAccessor(COMPLEX_X_ACCESSOR)(aspect) ?? - (() => (aspect.params as FakeParams)?.defaultValue) - ); -}; - -const getFieldName = (fieldName: string, index?: number) => { - const indexStr = index !== undefined ? `::${index}` : ''; - - return `${fieldName}${indexStr}`; -}; - -export const isRangeAggType = (type: string | null) => - type === BUCKET_TYPES.DATE_RANGE || type === BUCKET_TYPES.RANGE || type === BUCKET_TYPES.IP_RANGE; - -/** - * Returns accessor function for complex accessor types - * @param aspect - * @param isComplex - forces to be functional/complex accessor - */ -export const getComplexAccessor = - (fieldName: string, isComplex: boolean = false) => - (aspect: Aspect, index?: number): Accessor | AccessorFn | undefined => { - if (!aspect.accessor || aspect.aggType === SHARD_DELAY) { - return; - } - - if (!((isComplex || isRangeAggType(aspect.aggType)) && aspect.formatter)) { - return aspect.accessor; - } - - const formatter = aspect.formatter; - const accessor = aspect.accessor; - const fn: AccessorFn = (d) => { - const v = d[accessor]; - if (v === undefined) { - return; - } - const f = formatter(v); - return f; - }; - - fn.fieldName = getFieldName(fieldName, index); - - return fn; - }; - -export const getSplitSeriesAccessorFnMap = ( - splitSeriesAccessors: Array -): Map => { - const m = new Map(); - - splitSeriesAccessors.forEach((accessor, index) => { - if (typeof accessor === 'function') { - const fieldName = getFieldName(COMPLEX_SPLIT_ACCESSOR, index); - m.set(fieldName, accessor); - } - }); - - return m; -}; - // For percentile, the aggregation id is coming in the form %s.%d, where %s is agg_id and %d - percents export const getSafeId = (columnId?: number | string | null) => { const id = String(columnId); @@ -89,12 +17,3 @@ export const getSafeId = (columnId?: number | string | null) => { const baseId = id.substring(0, id.indexOf('[') !== -1 ? id.indexOf('[') : id.indexOf('.')); return baseId; }; - -export const isPercentileIdEqualToSeriesId = ( - columnId: number | string | null | undefined, - seriesColumnId: string -) => getSafeId(columnId) === seriesColumnId; - -export const isValidSeriesForDimension = (seriesColumnId: string, { aggId, accessor }: Aspect) => - (aggId === seriesColumnId || isPercentileIdEqualToSeriesId(aggId ?? '', seriesColumnId)) && - accessor !== null; diff --git a/src/plugins/vis_types/xy/public/utils/compute_percentage_data.test.ts b/src/plugins/vis_types/xy/public/utils/compute_percentage_data.test.ts deleted file mode 100644 index 0429bb5253b6f..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/compute_percentage_data.test.ts +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { computePercentageData } from './compute_percentage_data'; - -const rowsOneMetric = [ - { - 'col-0-4': 'Kibana Airlines', - 'col-1-1': 85, - }, - { - 'col-0-4': 'ES-Air', - 'col-1-1': 84, - }, - { - 'col-0-4': 'Logstash Airways', - 'col-1-1': 82, - }, - { - 'col-0-4': 'JetBeats', - 'col-1-1': 81, - }, -]; - -const twoMetricsRows = [ - { - 'col-0-4': 'ES-Air', - 'col-1-5': 10, - 'col-2-1': 71, - 'col-3-1': 1, - }, - { - 'col-0-4': 'ES-Air', - 'col-1-5': 9, - 'col-2-1': 14, - 'col-3-1': 1, - }, - { - 'col-0-4': 'Kibana Airlines', - 'col-1-5': 5, - 'col-2-1': 71, - 'col-3-1': 0, - }, - { - 'col-0-4': 'Kibana Airlines', - 'col-1-5': 8, - 'col-2-1': 13, - 'col-3-1': 1, - }, - { - 'col-0-4': 'JetBeats', - 'col-1-5': 11, - 'col-2-1': 72, - 'col-3-1': 0, - }, - { - 'col-0-4': 'JetBeats', - 'col-1-5': 12, - 'col-2-1': 9, - 'col-3-1': 0, - }, - { - 'col-0-4': 'Logstash Airways', - 'col-1-5': 5, - 'col-2-1': 71, - 'col-3-1': 1, - }, - { - 'col-0-4': 'Logstash Airways', - 'col-1-5': 7, - 'col-2-1': 10, - 'col-3-1': 0, - }, -]; - -describe('computePercentageData', () => { - it('returns ratio 1 if there is only one metric in the axis', () => { - const data = computePercentageData(rowsOneMetric, 'col-0-4', ['col-1-1']); - expect(data).toStrictEqual([ - { - 'col-0-4': 'Kibana Airlines', - 'col-1-1': 1, - }, - { - 'col-0-4': 'ES-Air', - 'col-1-1': 1, - }, - { - 'col-0-4': 'Logstash Airways', - 'col-1-1': 1, - }, - { - 'col-0-4': 'JetBeats', - 'col-1-1': 1, - }, - ]); - }); - - it('returns correct ratio if there are two metrics in the same axis with no small multiples', () => { - const data = computePercentageData(twoMetricsRows, 'col-0-4', ['col-1-5', 'col-2-1']); - expect(data).toStrictEqual([ - { - 'col-0-4': 'ES-Air', - 'col-1-5': 0.09615384615384616, - 'col-2-1': 0.6826923076923077, - 'col-3-1': 1, - }, - { - 'col-0-4': 'ES-Air', - 'col-1-5': 0.08653846153846154, - 'col-2-1': 0.1346153846153846, - 'col-3-1': 1, - }, - { - 'col-0-4': 'Kibana Airlines', - 'col-1-5': 0.05154639175257732, - 'col-2-1': 0.7319587628865979, - 'col-3-1': 0, - }, - { - 'col-0-4': 'Kibana Airlines', - 'col-1-5': 0.08247422680412371, - 'col-2-1': 0.13402061855670103, - 'col-3-1': 1, - }, - { - 'col-0-4': 'JetBeats', - 'col-1-5': 0.10576923076923077, - 'col-2-1': 0.6923076923076923, - 'col-3-1': 0, - }, - { - 'col-0-4': 'JetBeats', - 'col-1-5': 0.11538461538461539, - 'col-2-1': 0.08653846153846154, - 'col-3-1': 0, - }, - { - 'col-0-4': 'Logstash Airways', - 'col-1-5': 0.053763440860215055, - 'col-2-1': 0.7634408602150538, - 'col-3-1': 1, - }, - { - 'col-0-4': 'Logstash Airways', - 'col-1-5': 0.07526881720430108, - 'col-2-1': 0.10752688172043011, - 'col-3-1': 0, - }, - ]); - }); - - it('returns correct ratio if there are two metrics in the same axis with small multiples', () => { - const data = computePercentageData( - twoMetricsRows, - 'col-0-4', - ['col-1-5', 'col-2-1'], - 'col-3-1' - ); - expect(data).toStrictEqual([ - { - 'col-0-4': 'ES-Air', - 'col-1-5': 0.09615384615384616, - 'col-2-1': 0.6826923076923077, - 'col-3-1': 1, - }, - { - 'col-0-4': 'ES-Air', - 'col-1-5': 0.08653846153846154, - 'col-2-1': 0.1346153846153846, - 'col-3-1': 1, - }, - { - 'col-0-4': 'Kibana Airlines', - 'col-1-5': 0.06578947368421052, - 'col-2-1': 0.9342105263157895, - 'col-3-1': 0, - }, - { - 'col-0-4': 'Kibana Airlines', - 'col-1-5': 0.38095238095238093, - 'col-2-1': 0.6190476190476191, - 'col-3-1': 1, - }, - { - 'col-0-4': 'JetBeats', - 'col-1-5': 0.10576923076923077, - 'col-2-1': 0.6923076923076923, - 'col-3-1': 0, - }, - { - 'col-0-4': 'JetBeats', - 'col-1-5': 0.11538461538461539, - 'col-2-1': 0.08653846153846154, - 'col-3-1': 0, - }, - { - 'col-0-4': 'Logstash Airways', - 'col-1-5': 0.06578947368421052, - 'col-2-1': 0.9342105263157895, - 'col-3-1': 1, - }, - { - 'col-0-4': 'Logstash Airways', - 'col-1-5': 0.4117647058823529, - 'col-2-1': 0.5882352941176471, - 'col-3-1': 0, - }, - ]); - }); -}); diff --git a/src/plugins/vis_types/xy/public/utils/compute_percentage_data.ts b/src/plugins/vis_types/xy/public/utils/compute_percentage_data.ts deleted file mode 100644 index 65b43495d8c6d..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/compute_percentage_data.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 type { Accessor, AccessorFn } from '@elastic/charts'; -import { computeRatioByGroups } from '@elastic/charts'; -import type { DatatableRow } from '@kbn/expressions-plugin/public'; - -export const computePercentageData = ( - rows: DatatableRow[], - xAccessor: Accessor | AccessorFn, - yAccessors: string[], - splitChartAccessor?: string | null -) => { - // compute percentage mode data - const groupAccessors = [String(xAccessor)]; - if (splitChartAccessor) { - groupAccessors.push(splitChartAccessor); - } - - return computeRatioByGroups( - rows, - groupAccessors, - yAccessors.map((accessor) => { - return [(d) => d[accessor], (d, v) => ({ ...d, [accessor]: v })]; - }) - ); -}; diff --git a/src/plugins/vis_types/xy/public/utils/domain.ts b/src/plugins/vis_types/xy/public/utils/domain.ts deleted file mode 100644 index 1f07509f55aa1..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/domain.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { uniq } from 'lodash'; -import { unitOfTime } from 'moment'; - -import { DomainRange } from '@elastic/charts'; - -import { getAdjustedInterval } from '@kbn/charts-plugin/public'; -import { Datatable } from '@kbn/expressions-plugin/public'; -import { DateHistogramParams, HistogramParams } from '@kbn/visualizations-plugin/public'; - -import { Aspect } from '../types'; - -export const getXDomain = (params: Aspect['params']): DomainRange => { - const minInterval = (params as DateHistogramParams | HistogramParams)?.interval ?? undefined; - const bounds = (params as DateHistogramParams).date - ? (params as DateHistogramParams).bounds - : null; - - if (bounds) { - return { - min: bounds.min as number, - max: bounds.max as number, - minInterval, - }; - } - - return { - minInterval, - min: NaN, - max: NaN, - }; -}; - -export const getAdjustedDomain = ( - data: Datatable['rows'], - { accessor, params }: Aspect, - timeZone: string, - domain: DomainRange | undefined, - hasBars?: boolean -): DomainRange => { - if ( - accessor && - domain && - 'min' in domain && - 'max' in domain && - 'intervalESValue' in params && - 'intervalESUnit' in params - ) { - const { interval, intervalESValue, intervalESUnit } = params; - const xValues = uniq(data.map((d) => d[accessor]).sort()); - - const [firstXValue] = xValues; - const lastXValue = xValues[xValues.length - 1]; - - const domainMin = Math.min(firstXValue, domain.min); - const domainMaxValue = Math.max(domain.max - interval, lastXValue); - const domainMax = hasBars ? domainMaxValue : domainMaxValue + interval; - const minInterval = getAdjustedInterval( - xValues, - intervalESValue, - intervalESUnit as unitOfTime.Base, - timeZone - ); - - return { - min: domainMin, - max: domainMax, - minInterval, - }; - } - - return { - minInterval: 'interval' in params ? params.interval : undefined, - min: NaN, - max: NaN, - }; -}; diff --git a/src/plugins/vis_types/xy/public/utils/get_all_series.test.ts b/src/plugins/vis_types/xy/public/utils/get_all_series.test.ts deleted file mode 100644 index 6c6b78dfd73f7..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/get_all_series.test.ts +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { getAllSeries } from './get_all_series'; - -const rowsNoSplitSeries = [ - { - 'col-0-4': 'Kibana Airlines', - 'col-1-1': 85, - }, - { - 'col-0-4': 'ES-Air', - 'col-1-1': 84, - }, - { - 'col-0-4': 'Logstash Airways', - 'col-1-1': 82, - }, - { - 'col-0-4': 'JetBeats', - 'col-1-1': 81, - }, -]; - -const rowsWithSplitSeries = [ - { - 'col-0-4': 'ES-Air', - 'col-1-5': 0, - 'col-2-1': 71, - }, - { - 'col-0-4': 'ES-Air', - 'col-1-5': 1, - 'col-2-1': 14, - }, - { - 'col-0-4': 'Kibana Airlines', - 'col-1-5': 0, - 'col-2-1': 71, - }, - { - 'col-0-4': 'Kibana Airlines', - 'col-1-5': 1, - 'col-2-1': 13, - }, - { - 'col-0-4': 'JetBeats', - 'col-1-5': 0, - 'col-2-1': 72, - }, - { - 'col-0-4': 'JetBeats', - 'col-1-5': 1, - 'col-2-1': 9, - }, - { - 'col-0-4': 'Logstash Airways', - 'col-1-5': 0, - 'col-2-1': 71, - }, - { - 'col-0-4': 'Logstash Airways', - 'col-1-5': 1, - 'col-2-1': 10, - }, -]; - -const yAspects = [ - { - accessor: 'col-2-1', - column: 2, - title: 'Count', - format: { - id: 'number', - }, - aggType: 'count', - aggId: '1', - params: {}, - }, -]; - -const myltipleYAspects = [ - { - accessor: 'col-2-1', - column: 2, - title: 'Count', - format: { - id: 'number', - }, - aggType: 'count', - aggId: '1', - params: {}, - }, - { - accessor: 'col-3-4', - column: 3, - title: 'Average AvgTicketPrice', - format: { - id: 'number', - params: { - pattern: '$0,0.[00]', - }, - }, - aggType: 'avg', - aggId: '4', - params: {}, - }, -]; - -describe('getAllSeries', () => { - it('returns empty array if splitAccessors is undefined', () => { - const splitAccessors = undefined; - const series = getAllSeries(rowsNoSplitSeries, splitAccessors, yAspects); - expect(series).toStrictEqual([]); - }); - - it('returns an array of series names if splitAccessors is an array', () => { - const splitAccessors = [ - { - accessor: 'col-1-5', - }, - ]; - const series = getAllSeries(rowsWithSplitSeries, splitAccessors, yAspects); - expect(series).toStrictEqual([0, 1]); - }); - - it('returns the correct array of series names for two splitAccessors without duplicates', () => { - const splitAccessors = [ - { - accessor: 'col-0-4', - }, - { - accessor: 'col-1-5', - }, - ]; - const series = getAllSeries(rowsWithSplitSeries, splitAccessors, yAspects); - expect(series).toStrictEqual([ - 'ES-Air - 0', - 'ES-Air - 1', - 'Kibana Airlines - 0', - 'Kibana Airlines - 1', - 'JetBeats - 0', - 'JetBeats - 1', - 'Logstash Airways - 0', - 'Logstash Airways - 1', - ]); - }); - - it('returns the correct array of series names for two splitAccessors and two y axis', () => { - const splitAccessors = [ - { - accessor: 'col-0-4', - }, - { - accessor: 'col-1-5', - }, - ]; - const series = getAllSeries(rowsWithSplitSeries, splitAccessors, myltipleYAspects); - expect(series).toStrictEqual([ - 'ES-Air - 0: Count', - 'ES-Air - 0: Average AvgTicketPrice', - 'ES-Air - 1: Count', - 'ES-Air - 1: Average AvgTicketPrice', - 'Kibana Airlines - 0: Count', - 'Kibana Airlines - 0: Average AvgTicketPrice', - 'Kibana Airlines - 1: Count', - 'Kibana Airlines - 1: Average AvgTicketPrice', - 'JetBeats - 0: Count', - 'JetBeats - 0: Average AvgTicketPrice', - 'JetBeats - 1: Count', - 'JetBeats - 1: Average AvgTicketPrice', - 'Logstash Airways - 0: Count', - 'Logstash Airways - 0: Average AvgTicketPrice', - 'Logstash Airways - 1: Count', - 'Logstash Airways - 1: Average AvgTicketPrice', - ]); - }); -}); diff --git a/src/plugins/vis_types/xy/public/utils/get_all_series.ts b/src/plugins/vis_types/xy/public/utils/get_all_series.ts deleted file mode 100644 index 6ec625cb884c1..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/get_all_series.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { TickFormatter } from '@elastic/charts'; -import { DatatableRow } from '@kbn/expressions-plugin/public'; -import { Column, Aspect } from '../types'; - -interface SplitAccessors { - accessor: Column['id']; - formatter?: TickFormatter; -} - -export const getAllSeries = ( - rows: DatatableRow[], - splitAccessors: SplitAccessors[] | undefined, - yAspects: Aspect[] -) => { - const allSeries: string[] = []; - if (!splitAccessors) return []; - - rows.forEach((row) => { - let seriesName = ''; - splitAccessors?.forEach(({ accessor, formatter }) => { - if (!accessor) return; - const name = formatter ? formatter(row[accessor]) : row[accessor]; - if (seriesName) { - seriesName += ` - ${name}`; - } else { - seriesName = name; - } - }); - - // multiple y axis - if (yAspects.length > 1) { - yAspects.forEach((aspect) => { - if (!allSeries.includes(`${seriesName}: ${aspect.title}`)) { - allSeries.push(`${seriesName}: ${aspect.title}`); - } - }); - } else { - if (!allSeries.includes(seriesName)) { - allSeries.push(seriesName); - } - } - }); - return allSeries; -}; diff --git a/src/plugins/vis_types/xy/public/utils/get_color_picker.test.tsx b/src/plugins/vis_types/xy/public/utils/get_color_picker.test.tsx deleted file mode 100644 index 6c541fc27161e..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/get_color_picker.test.tsx +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { LegendColorPickerProps, XYChartSeriesIdentifier } from '@elastic/charts'; -import { EuiPopover } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { ComponentType, ReactWrapper } from 'enzyme'; -import { getColorPicker } from './get_color_picker'; -import { ColorPicker } from '@kbn/charts-plugin/public'; -import type { PersistedState } from '@kbn/visualizations-plugin/public'; - -jest.mock('@elastic/charts', () => { - const original = jest.requireActual('@elastic/charts'); - - return { - ...original, - getSpecId: jest.fn(() => {}), - }; -}); - -describe('getColorPicker', function () { - const mockState = new Map(); - const uiState = { - get: jest - .fn() - .mockImplementation((key, fallback) => (mockState.has(key) ? mockState.get(key) : fallback)), - set: jest.fn().mockImplementation((key, value) => mockState.set(key, value)), - emit: jest.fn(), - setSilent: jest.fn(), - } as unknown as PersistedState; - - let wrapperProps: LegendColorPickerProps; - const Component: ComponentType = getColorPicker( - 'left', - jest.fn(), - jest.fn().mockImplementation((seriesIdentifier) => seriesIdentifier.seriesKeys[0]), - 'default', - uiState - ); - let wrapper: ReactWrapper; - - beforeAll(() => { - wrapperProps = { - color: 'rgb(109, 204, 177)', - onClose: jest.fn(), - onChange: jest.fn(), - anchor: document.createElement('div'), - seriesIdentifiers: [ - { - yAccessor: 'col-2-1', - splitAccessors: {}, - seriesKeys: ['Logstash Airways', 'col-2-1'], - specId: 'histogram-col-2-1', - key: 'groupId{__pseudo_stacked_group-ValueAxis-1__}spec{histogram-col-2-1}yAccessor{col-2-1}splitAccessors{col-1-3-Logstash Airways}', - } as XYChartSeriesIdentifier, - ], - }; - }); - - it('renders the color picker', () => { - wrapper = mountWithIntl(); - expect(wrapper.find(ColorPicker).length).toBe(1); - }); - - it('renders the color picker with the colorIsOverwritten prop set to false if color is not overwritten for the specific series', () => { - wrapper = mountWithIntl(); - expect(wrapper.find(ColorPicker).prop('colorIsOverwritten')).toBe(false); - }); - - it('renders the color picker with the colorIsOverwritten prop set to true if color is overwritten for the specific series', () => { - uiState.set('vis.colors', { 'Logstash Airways': '#6092c0' }); - wrapper = mountWithIntl(); - expect(wrapper.find(ColorPicker).prop('colorIsOverwritten')).toBe(true); - }); - - it('renders the picker on the correct position', () => { - wrapper = mountWithIntl(); - expect(wrapper.find(EuiPopover).prop('anchorPosition')).toEqual('rightCenter'); - }); - - it('renders the picker for kibana palette with useLegacyColors set to true', () => { - const LegacyPaletteComponent: ComponentType = getColorPicker( - 'left', - jest.fn(), - jest.fn(), - 'kibana_palette', - uiState - ); - wrapper = mountWithIntl(); - expect(wrapper.find(ColorPicker).prop('useLegacyColors')).toBe(true); - }); -}); diff --git a/src/plugins/vis_types/xy/public/utils/get_color_picker.tsx b/src/plugins/vis_types/xy/public/utils/get_color_picker.tsx deleted file mode 100644 index 18ba4296e2545..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/get_color_picker.tsx +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { useCallback } from 'react'; - -import { LegendColorPicker, Position, XYChartSeriesIdentifier, SeriesName } from '@elastic/charts'; -import { PopoverAnchorPosition, EuiWrappingPopover, EuiOutsideClickDetector } from '@elastic/eui'; -import type { PersistedState } from '@kbn/visualizations-plugin/public'; -import { ColorPicker } from '@kbn/charts-plugin/public'; - -function getAnchorPosition(legendPosition: Position): PopoverAnchorPosition { - switch (legendPosition) { - case Position.Bottom: - return 'upCenter'; - case Position.Top: - return 'downCenter'; - case Position.Left: - return 'rightCenter'; - default: - return 'leftCenter'; - } -} - -const KEY_CODE_ENTER = 13; - -export const getColorPicker = - ( - legendPosition: Position, - setColor: (newColor: string | null, seriesKey: string | number) => void, - getSeriesName: (series: XYChartSeriesIdentifier) => SeriesName, - paletteName: string, - uiState: PersistedState - ): LegendColorPicker => - ({ anchor, color, onClose, onChange, seriesIdentifiers: [seriesIdentifier] }) => { - const seriesName = getSeriesName(seriesIdentifier as XYChartSeriesIdentifier); - const overwriteColors: Record = uiState?.get('vis.colors', {}); - const colorIsOverwritten = Object.keys(overwriteColors).includes(seriesName as string); - let keyDownEventOn = false; - - const handleChange = (newColor: string | null) => { - if (!seriesName) { - return; - } - if (newColor) { - onChange(newColor); - } - setColor(newColor, seriesName); - // close the popover if no color is applied or the user has clicked a color - if (!newColor || !keyDownEventOn) { - onClose(); - } - }; - - const onKeyDown = (e: React.KeyboardEvent) => { - if (e.keyCode === KEY_CODE_ENTER) { - onClose?.(); - } - keyDownEventOn = true; - }; - - const handleOutsideClick = useCallback(() => { - onClose?.(); - }, [onClose]); - - return ( - - - - - - ); - }; diff --git a/src/plugins/vis_types/xy/public/utils/get_legend_actions.tsx b/src/plugins/vis_types/xy/public/utils/get_legend_actions.tsx deleted file mode 100644 index 3d79b607c4da1..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/get_legend_actions.tsx +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 } from 'react'; - -import { i18n } from '@kbn/i18n'; -import { EuiContextMenuPanelDescriptor, EuiIcon, EuiPopover, EuiContextMenu } from '@elastic/eui'; -import { - LegendAction, - XYChartSeriesIdentifier, - SeriesName, - useLegendAction, -} from '@elastic/charts'; - -import { ClickTriggerEvent } from '@kbn/charts-plugin/public'; - -export const getLegendActions = ( - canFilter: (data: ClickTriggerEvent | null) => Promise, - getFilterEventData: (series: XYChartSeriesIdentifier) => ClickTriggerEvent | null, - onFilter: (data: ClickTriggerEvent, negate?: any) => void, - getSeriesName: (series: XYChartSeriesIdentifier) => SeriesName -): LegendAction => { - return ({ series: [xySeries] }) => { - const [popoverOpen, setPopoverOpen] = useState(false); - const [isfilterable, setIsfilterable] = useState(false); - const series = xySeries as XYChartSeriesIdentifier; - const filterData = useMemo(() => getFilterEventData(series), [series]); - const [ref, onClose] = useLegendAction(); - - useEffect(() => { - (async () => setIsfilterable(await canFilter(filterData)))(); - }, [filterData]); - - if (!isfilterable || !filterData) { - return null; - } - - const name = getSeriesName(series); - const panels: EuiContextMenuPanelDescriptor[] = [ - { - id: 'main', - title: `${name}`, - items: [ - { - name: i18n.translate('visTypeXy.legend.filterForValueButtonAriaLabel', { - defaultMessage: 'Filter for value', - }), - 'data-test-subj': `legend-${name}-filterIn`, - icon: , - onClick: () => { - setPopoverOpen(false); - onFilter(filterData); - }, - }, - { - name: i18n.translate('visTypeXy.legend.filterOutValueButtonAriaLabel', { - defaultMessage: 'Filter out value', - }), - 'data-test-subj': `legend-${name}-filterOut`, - icon: , - onClick: () => { - setPopoverOpen(false); - onFilter(filterData, true); - }, - }, - ], - }, - ]; - - const Button = ( -
setPopoverOpen(!popoverOpen)} - onClick={() => setPopoverOpen(!popoverOpen)} - > - -
- ); - - return ( - { - setPopoverOpen(false); - onClose(); - }} - panelPaddingSize="none" - anchorPosition="upLeft" - title={i18n.translate('visTypeXy.legend.filterOptionsLegend', { - defaultMessage: '{legendDataLabel}, filter options', - values: { legendDataLabel: name }, - })} - > - - - ); - }; -}; diff --git a/src/plugins/vis_types/xy/public/utils/get_series_name_fn.test.ts b/src/plugins/vis_types/xy/public/utils/get_series_name_fn.test.ts deleted file mode 100644 index 88be9ab160896..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/get_series_name_fn.test.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { XYChartSeriesIdentifier } from '@elastic/charts'; -import { getSeriesNameFn } from './get_series_name_fn'; - -const aspects = { - series: [ - { - accessor: 'col-1-3', - column: 1, - title: 'FlightDelayType: Descending', - format: { - id: 'terms', - params: { - id: 'string', - otherBucketLabel: 'Other', - missingBucketLabel: 'Missing', - }, - }, - aggType: 'terms', - aggId: '3', - params: {}, - }, - ], - x: { - accessor: 'col-0-2', - column: 0, - title: 'timestamp per day', - format: { - id: 'date', - params: { - pattern: 'YYYY-MM-DD', - }, - }, - aggType: 'date_histogram', - aggId: '2', - params: { - date: true, - intervalESUnit: 'd', - intervalESValue: 1, - interval: 86400000, - format: 'YYYY-MM-DD', - }, - }, - y: [ - { - accessor: 'col-1-1', - column: 1, - title: 'Count', - format: { - id: 'number', - }, - aggType: 'count', - aggId: '1', - params: {}, - }, - ], -}; - -const series = { - specId: 'histogram-col-1-1', - seriesKeys: ['col-1-1'], - yAccessor: 'col-1-1', - splitAccessors: [], - smVerticalAccessorValue: '__ECH_DEFAULT_SINGLE_PANEL_SM_VALUE__', - smHorizontalAccessorValue: '__ECH_DEFAULT_SINGLE_PANEL_SM_VALUE__', - groupId: '__pseudo_stacked_group-ValueAxis-1__', - seriesType: 'bar', - isStacked: true, -} as unknown as XYChartSeriesIdentifier; - -const splitAccessors = new Map(); -splitAccessors.set('col-1-3', 'Weather Delay'); - -const seriesSplitAccessors = { - specId: 'histogram-col-2-1', - seriesKeys: ['Weather Delay', 'col-2-1'], - yAccessor: 'col-2-1', - splitAccessors, - smVerticalAccessorValue: '__ECH_DEFAULT_SINGLE_PANEL_SM_VALUE__', - smHorizontalAccessorValue: '__ECH_DEFAULT_SINGLE_PANEL_SM_VALUE__', - groupId: '__pseudo_stacked_group-ValueAxis-1__', - seriesType: 'bar', - isStacked: true, -} as unknown as XYChartSeriesIdentifier; - -describe('getSeriesNameFn', () => { - it('returns the y aspects title if splitAccessors are empty array', () => { - const getSeriesName = getSeriesNameFn(aspects, false); - expect(getSeriesName(series)).toStrictEqual('Count'); - }); - - it('returns the y aspects title if splitAccessors are empty array but mupliple flag is set to true', () => { - const getSeriesName = getSeriesNameFn(aspects, true); - expect(getSeriesName(series)).toStrictEqual('Count'); - }); - - it('returns the correct string for multiple set to false and given split accessors', () => { - const aspectsSplitSeries = { - ...aspects, - y: [ - { - accessor: 'col-2-1', - column: 2, - title: 'Count', - format: { - id: 'number', - }, - aggType: 'count', - aggId: '1', - params: {}, - }, - ], - }; - const getSeriesName = getSeriesNameFn(aspectsSplitSeries, false); - expect(getSeriesName(seriesSplitAccessors)).toStrictEqual('Weather Delay'); - }); - - it('returns the correct string for multiple set to true and given split accessors', () => { - const aspectsSplitSeries = { - ...aspects, - y: [ - { - accessor: 'col-2-1', - column: 2, - title: 'Count', - format: { - id: 'number', - }, - aggType: 'count', - aggId: '1', - params: {}, - }, - ], - }; - const getSeriesName = getSeriesNameFn(aspectsSplitSeries, true); - expect(getSeriesName(seriesSplitAccessors)).toStrictEqual('Weather Delay: Count'); - }); -}); diff --git a/src/plugins/vis_types/xy/public/utils/get_series_name_fn.ts b/src/plugins/vis_types/xy/public/utils/get_series_name_fn.ts deleted file mode 100644 index 8019e36c1e6d5..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/get_series_name_fn.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 { memoize } from 'lodash'; - -import { XYChartSeriesIdentifier, SeriesName } from '@elastic/charts'; - -import { VisConfig } from '../types'; - -function getSplitValues( - splitAccessors: XYChartSeriesIdentifier['splitAccessors'], - seriesAspects?: VisConfig['aspects']['series'] -) { - if (splitAccessors.size < 1) { - return []; - } - - const splitValues: Array = []; - splitAccessors.forEach((value, key) => { - const split = (seriesAspects ?? []).find(({ accessor }) => accessor === key); - splitValues.push(split?.formatter ? split?.formatter(value) : value); - }); - return splitValues; -} - -export const getSeriesNameFn = (aspects: VisConfig['aspects'], multipleY = false) => - memoize(({ splitAccessors, yAccessor }: XYChartSeriesIdentifier): SeriesName => { - const splitValues = getSplitValues(splitAccessors, aspects.series); - const yAccessorTitle = aspects.y.find(({ accessor }) => accessor === yAccessor)?.title ?? null; - - if (!yAccessorTitle) { - return null; - } - - if (multipleY) { - if (splitValues.length === 0) { - return yAccessorTitle; - } - return `${splitValues.join(' - ')}: ${yAccessorTitle}`; - } - - return splitValues.length > 0 ? splitValues.join(' - ') : yAccessorTitle; - }); diff --git a/src/plugins/vis_types/xy/public/utils/get_series_params.test.ts b/src/plugins/vis_types/xy/public/utils/get_series_params.test.ts deleted file mode 100644 index 21b2dac5da322..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/get_series_params.test.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 type { AggConfigs } from '@kbn/data-plugin/public'; -import type { SeriesParam } from '../types'; -import { getSeriesParams } from './get_series_params'; -import { sampleAreaVis } from '../sample_vis.test.mocks'; - -describe('getSeriesParams', () => { - it('returns correct params', () => { - const seriesParams = getSeriesParams( - sampleAreaVis.data.aggs as unknown as AggConfigs, - sampleAreaVis.params.seriesParams as unknown as SeriesParam[], - 'metric', - 'ValueAxis-1' - ); - expect(seriesParams).toStrictEqual([ - { - circlesRadius: 5, - data: { - id: '1', - label: 'Total quantity', - }, - drawLinesBetweenPoints: true, - interpolate: 'linear', - mode: 'stacked', - show: 'true', - showCircles: true, - type: 'area', - valueAxis: 'ValueAxis-1', - }, - ]); - }); - - it('returns default params if no params provided', () => { - const seriesParams = getSeriesParams( - sampleAreaVis.data.aggs as unknown as AggConfigs, - [], - 'metric', - 'ValueAxis-1' - ); - expect(seriesParams).toStrictEqual([ - { - circlesRadius: 1, - data: { - id: '1', - label: 'Total quantity', - }, - drawLinesBetweenPoints: true, - interpolate: 'linear', - lineWidth: 2, - mode: 'normal', - show: true, - showCircles: true, - type: 'line', - valueAxis: 'ValueAxis-1', - }, - ]); - }); -}); diff --git a/src/plugins/vis_types/xy/public/utils/get_time_zone.tsx b/src/plugins/vis_types/xy/public/utils/get_time_zone.tsx deleted file mode 100644 index 2d63eebbdc3e2..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/get_time_zone.tsx +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { getUISettings } from '../services'; - -/** - * Get timeZone from uiSettings - */ -export function getTimeZone() { - const uiSettings = getUISettings(); - if (uiSettings.isDefault('dateFormat:tz')) { - const detectedTimeZone = moment.tz.guess(); - if (detectedTimeZone) return detectedTimeZone; - else return moment().format('Z'); - } else { - return uiSettings.get('dateFormat:tz', 'Browser'); - } -} diff --git a/src/plugins/vis_types/xy/public/utils/index.tsx b/src/plugins/vis_types/xy/public/utils/index.tsx deleted file mode 100644 index d68a6e8068fa8..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/index.tsx +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may 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 { renderAllSeries } from './render_all_series'; -export { getTimeZone } from './get_time_zone'; -export { getLegendActions } from './get_legend_actions'; -export { getSeriesNameFn } from './get_series_name_fn'; -export { getXDomain, getAdjustedDomain } from './domain'; -export { getColorPicker } from './get_color_picker'; -export { getXAccessor } from './accessors'; -export { getAllSeries } from './get_all_series'; diff --git a/src/plugins/vis_types/xy/public/utils/render_all_series.test.mocks.ts b/src/plugins/vis_types/xy/public/utils/render_all_series.test.mocks.ts deleted file mode 100644 index 4c51d8cad64e4..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/render_all_series.test.mocks.ts +++ /dev/null @@ -1,529 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { AxisMode, VisConfig } from '../types'; - -export const getVisConfig = (): VisConfig => { - return { - markSizeRatio: 5.3999999999999995, - fittingFunction: 'linear', - detailedTooltip: true, - isTimeChart: true, - showCurrentTime: false, - showValueLabel: false, - enableHistogramMode: true, - tooltip: { - type: 'vertical', - }, - aspects: { - x: { - accessor: 'col-0-2', - column: 0, - title: 'order_date per minute', - format: { - id: 'date', - params: { - pattern: 'HH:mm', - }, - }, - aggType: 'date_histogram', - aggId: '2', - params: { - date: true, - intervalESUnit: 'm', - intervalESValue: 1, - interval: 60000, - format: 'HH:mm', - }, - }, - y: [ - { - accessor: 'col-1-3', - column: 1, - title: 'Average products.base_price', - format: { - id: 'number', - }, - aggType: 'avg', - aggId: '3', - params: {}, - }, - ], - }, - xAxis: { - id: 'CategoryAxis-1', - position: 'bottom', - show: true, - style: { - axisTitle: { - visible: true, - }, - tickLabel: { - visible: true, - rotation: 0, - }, - }, - groupId: 'CategoryAxis-1', - title: 'order_date per minute', - ticks: { - show: true, - showOverlappingLabels: false, - showDuplicates: false, - }, - grid: { - show: false, - }, - scale: { - type: 'time', - }, - integersOnly: false, - }, - yAxes: [ - { - id: 'ValueAxis-1', - position: 'left', - show: true, - style: { - axisTitle: { - visible: true, - }, - tickLabel: { - visible: true, - rotation: 0, - }, - }, - groupId: 'ValueAxis-1', - title: 'Avg of products.base_price', - ticks: { - show: true, - rotation: 0, - showOverlappingLabels: true, - showDuplicates: true, - }, - grid: { - show: false, - }, - scale: { - mode: AxisMode.Percentage, - type: 'linear', - }, - domain: { - min: NaN, - max: NaN, - }, - integersOnly: false, - }, - ], - legend: { - show: true, - position: 'right', - }, - rotation: 0, - thresholdLine: { - color: '#E7664C', - show: false, - value: 10, - width: 1, - groupId: 'ValueAxis-1', - }, - }; -}; - -export const getVisConfigMutipleYaxis = (): VisConfig => { - return { - markSizeRatio: 5.3999999999999995, - fittingFunction: 'linear', - detailedTooltip: true, - isTimeChart: true, - showCurrentTime: false, - showValueLabel: false, - enableHistogramMode: true, - tooltip: { - type: 'vertical', - }, - aspects: { - x: { - accessor: 'col-0-2', - column: 0, - title: 'order_date per minute', - format: { - id: 'date', - params: { - pattern: 'HH:mm', - }, - }, - aggType: 'date_histogram', - aggId: '2', - params: { - date: true, - intervalESUnit: 'm', - intervalESValue: 1, - interval: 60000, - format: 'HH:mm', - }, - }, - y: [ - { - accessor: 'col-1-3', - column: 1, - title: 'Average products.base_price', - format: { - id: 'number', - }, - aggType: 'avg', - aggId: '3', - params: {}, - }, - { - accessor: 'col-1-2', - column: 1, - title: 'Average products.taxful_price', - format: { - id: 'number', - }, - aggType: 'avg', - aggId: '33', - params: {}, - }, - ], - }, - xAxis: { - id: 'CategoryAxis-1', - position: 'bottom', - show: true, - style: { - axisTitle: { - visible: true, - }, - tickLabel: { - visible: true, - rotation: 0, - }, - }, - groupId: 'CategoryAxis-1', - title: 'order_date per minute', - ticks: { - show: true, - showOverlappingLabels: false, - showDuplicates: false, - }, - grid: { - show: false, - }, - scale: { - type: 'time', - }, - integersOnly: false, - }, - yAxes: [ - { - id: 'ValueAxis-1', - position: 'left', - show: true, - style: { - axisTitle: { - visible: true, - }, - tickLabel: { - visible: true, - rotation: 0, - }, - }, - groupId: 'ValueAxis-1', - title: 'Avg of products.base_price', - ticks: { - show: true, - rotation: 0, - showOverlappingLabels: true, - showDuplicates: true, - }, - grid: { - show: false, - }, - scale: { - mode: AxisMode.Normal, - type: 'linear', - }, - domain: { - min: NaN, - max: NaN, - }, - integersOnly: false, - }, - ], - legend: { - show: true, - position: 'right', - }, - rotation: 0, - thresholdLine: { - color: '#E7664C', - show: false, - value: 10, - width: 1, - groupId: 'ValueAxis-1', - }, - }; -}; - -export const getVisConfigPercentiles = (): VisConfig => { - return { - markSizeRatio: 5.3999999999999995, - fittingFunction: 'linear', - detailedTooltip: true, - isTimeChart: true, - showCurrentTime: false, - showValueLabel: false, - enableHistogramMode: true, - tooltip: { - type: 'vertical', - }, - aspects: { - x: { - accessor: 'col-0-2', - column: 0, - title: 'order_date per minute', - format: { - id: 'date', - params: { - pattern: 'HH:mm', - }, - }, - aggType: 'date_histogram', - aggId: '2', - params: { - date: true, - intervalESUnit: 'm', - intervalESValue: 1, - interval: 60000, - format: 'HH:mm', - }, - }, - y: [ - { - accessor: 'col-1-3.1', - column: 1, - title: '1st percentile of products.base_price', - format: { - id: 'number', - }, - aggType: 'percentiles', - aggId: '3.1', - params: {}, - }, - { - accessor: 'col-2-3.5', - column: 2, - title: '5th percentile of products.base_price', - format: { - id: 'number', - }, - aggType: 'percentiles', - aggId: '3.5', - params: {}, - }, - { - accessor: 'col-3-3.25', - column: 3, - title: '25th percentile of products.base_price', - format: { - id: 'number', - }, - aggType: 'percentiles', - aggId: '3.25', - params: {}, - }, - { - accessor: 'col-4-3.50', - column: 4, - title: '50th percentile of products.base_price', - format: { - id: 'number', - }, - aggType: 'percentiles', - aggId: '3.50', - params: {}, - }, - { - accessor: 'col-5-3.75', - column: 5, - title: '75th percentile of products.base_price', - format: { - id: 'number', - }, - aggType: 'percentiles', - aggId: '3.75', - params: {}, - }, - { - accessor: 'col-6-3.95', - column: 6, - title: '95th percentile of products.base_price', - format: { - id: 'number', - }, - aggType: 'percentiles', - aggId: '3.95', - params: {}, - }, - { - accessor: 'col-7-3.99', - column: 7, - title: '99th percentile of products.base_price', - format: { - id: 'number', - }, - aggType: 'percentiles', - aggId: '3.99', - params: {}, - }, - ], - }, - xAxis: { - id: 'CategoryAxis-1', - position: 'bottom', - show: true, - style: { - axisTitle: { - visible: true, - }, - tickLabel: { - visible: true, - rotation: 0, - }, - }, - groupId: 'CategoryAxis-1', - title: 'order_date per minute', - ticks: { - show: true, - showOverlappingLabels: false, - showDuplicates: false, - }, - grid: { - show: false, - }, - scale: { - type: 'time', - }, - integersOnly: false, - }, - yAxes: [ - { - id: 'ValueAxis-1', - position: 'left', - show: true, - style: { - axisTitle: { - visible: true, - }, - tickLabel: { - visible: true, - rotation: 0, - }, - }, - groupId: 'ValueAxis-1', - title: 'Percentiles of products.base_price', - ticks: { - show: true, - rotation: 0, - showOverlappingLabels: true, - showDuplicates: true, - }, - grid: { - show: false, - }, - scale: { - mode: AxisMode.Normal, - type: 'linear', - }, - domain: { - min: NaN, - max: NaN, - }, - integersOnly: false, - }, - ], - legend: { - show: true, - position: 'right', - }, - rotation: 0, - thresholdLine: { - color: '#E7664C', - show: false, - value: 10, - width: 1, - groupId: 'ValueAxis-1', - }, - }; -}; - -export const getPercentilesData = () => { - return [ - { - 'col-0-2': 1610961900000, - 'col-1-3.1': 11.9921875, - 'col-2-3.5': 11.9921875, - 'col-3-3.25': 11.9921875, - 'col-4-3.50': 38.49609375, - 'col-5-3.75': 65, - 'col-6-3.95': 65, - 'col-7-3.99': 65, - }, - { - 'col-0-2': 1610962980000, - 'col-1-3.1': 28.984375000000004, - 'col-2-3.5': 28.984375, - 'col-3-3.25': 28.984375, - 'col-4-3.50': 30.9921875, - 'col-5-3.75': 41.5, - 'col-6-3.95': 50, - 'col-7-3.99': 50, - }, - { - 'col-0-2': 1610963280000, - 'col-1-3.1': 11.9921875, - 'col-2-3.5': 11.9921875, - 'col-3-3.25': 11.9921875, - 'col-4-3.50': 12.9921875, - 'col-5-3.75': 13.9921875, - 'col-6-3.95': 13.9921875, - 'col-7-3.99': 13.9921875, - }, - { - 'col-0-2': 1610964180000, - 'col-1-3.1': 11.9921875, - 'col-2-3.5': 11.9921875, - 'col-3-3.25': 14.9921875, - 'col-4-3.50': 15.98828125, - 'col-5-3.75': 24.984375, - 'col-6-3.95': 85, - 'col-7-3.99': 85, - }, - { - 'col-0-2': 1610964420000, - 'col-1-3.1': 11.9921875, - 'col-2-3.5': 11.9921875, - 'col-3-3.25': 11.9921875, - 'col-4-3.50': 23.99609375, - 'col-5-3.75': 42, - 'col-6-3.95': 42, - 'col-7-3.99': 42, - }, - { - 'col-0-2': 1610964600000, - 'col-1-3.1': 10.9921875, - 'col-2-3.5': 10.992187500000002, - 'col-3-3.25': 10.9921875, - 'col-4-3.50': 12.4921875, - 'col-5-3.75': 13.9921875, - 'col-6-3.95': 13.9921875, - 'col-7-3.99': 13.9921875, - }, - ]; -}; diff --git a/src/plugins/vis_types/xy/public/utils/render_all_series.test.tsx b/src/plugins/vis_types/xy/public/utils/render_all_series.test.tsx deleted file mode 100644 index 6be7c31cb1060..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/render_all_series.test.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React from 'react'; -import { shallow } from 'enzyme'; -import { AreaSeries, BarSeries, CurveType } from '@elastic/charts'; -import { DatatableRow } from '@kbn/expressions-plugin/public'; -import { renderAllSeries } from './render_all_series'; -import { - getVisConfig, - getVisConfigPercentiles, - getPercentilesData, - getVisConfigMutipleYaxis, -} from './render_all_series.test.mocks'; -import { SeriesParam, VisConfig } from '../types'; - -const defaultSeriesParams = [ - { - data: { - id: '3', - label: 'Label', - }, - drawLinesBetweenPoints: true, - interpolate: 'linear', - lineWidth: 2, - mode: 'stacked', - show: true, - showCircles: true, - circlesRadius: 3, - type: 'area', - valueAxis: 'ValueAxis-1', - }, -] as SeriesParam[]; - -const defaultData = [ - { - 'col-0-2': 1610960220000, - 'col-1-3': 26.984375, - }, - { - 'col-0-2': 1610961300000, - 'col-1-3': 30.99609375, - }, - { - 'col-0-2': 1610961900000, - 'col-1-3': 38.49609375, - }, - { - 'col-0-2': 1610962980000, - 'col-1-3': 35.2421875, - }, -]; - -describe('renderAllSeries', function () { - const getAllSeries = (visConfig: VisConfig, params: SeriesParam[], data: DatatableRow[]) => { - return renderAllSeries( - visConfig, - params, - data, - jest.fn(), - jest.fn(), - 'Europe/Athens', - 'col-0-2', - [] - ); - }; - - it('renders an area Series and not a bar series if type is area', () => { - const renderSeries = getAllSeries(getVisConfig(), defaultSeriesParams, defaultData); - const wrapper = shallow(
{renderSeries}
); - expect(wrapper.find(AreaSeries).length).toBe(1); - expect(wrapper.find(BarSeries).length).toBe(0); - }); - - it('renders a bar Series in case of histogram', () => { - const barSeriesParams = [{ ...defaultSeriesParams[0], type: 'histogram' }]; - - const renderBarSeries = renderAllSeries( - getVisConfig(), - barSeriesParams as SeriesParam[], - defaultData, - jest.fn(), - jest.fn(), - 'Europe/Athens', - 'col-0-2', - [] - ); - const wrapper = shallow(
{renderBarSeries}
); - expect(wrapper.find(AreaSeries).length).toBe(0); - expect(wrapper.find(BarSeries).length).toBe(1); - }); - - it('renders percentage data for percentage mode', () => { - const barSeriesParams = [{ ...defaultSeriesParams[0], type: 'histogram', mode: 'percentage' }]; - const config = getVisConfig(); - - const renderBarSeries = renderAllSeries( - config, - barSeriesParams as SeriesParam[], - defaultData, - jest.fn(), - jest.fn(), - 'Europe/Athens', - 'col-0-2', - [] - ); - const wrapper = shallow(
{renderBarSeries}
); - expect(wrapper.find(BarSeries).length).toBe(1); - expect(wrapper.find(BarSeries).prop('stackMode')).toEqual('percentage'); - expect(wrapper.find(BarSeries).prop('data')).toEqual([ - { - 'col-0-2': 1610960220000, - 'col-1-3': 1, - }, - { - 'col-0-2': 1610961300000, - 'col-1-3': 1, - }, - { - 'col-0-2': 1610961900000, - 'col-1-3': 1, - }, - { - 'col-0-2': 1610962980000, - 'col-1-3': 1, - }, - ]); - }); - - it('renders the correct yAccessors for not percentile aggs', () => { - const renderSeries = getAllSeries(getVisConfig(), defaultSeriesParams, defaultData); - const wrapper = shallow(
{renderSeries}
); - expect(wrapper.find(AreaSeries).prop('yAccessors')).toEqual(['col-1-3']); - }); - - it('renders the correct yAccessors for multiple yAxis', () => { - const mutipleYAxisConfig = getVisConfigMutipleYaxis(); - const renderMutipleYAxisSeries = renderAllSeries( - mutipleYAxisConfig, - defaultSeriesParams as SeriesParam[], - defaultData, - jest.fn(), - jest.fn(), - 'Europe/Athens', - 'col-0-2', - [] - ); - const wrapper = shallow(
{renderMutipleYAxisSeries}
); - expect(wrapper.find(AreaSeries).prop('yAccessors')).toEqual(['col-1-3']); - }); - - it('renders the correct yAccessors for percentile aggs', () => { - const percentilesConfig = getVisConfigPercentiles(); - const percentilesData = getPercentilesData(); - const renderPercentileSeries = renderAllSeries( - percentilesConfig, - defaultSeriesParams as SeriesParam[], - percentilesData, - jest.fn(), - jest.fn(), - 'Europe/Athens', - 'col-0-2', - [] - ); - const wrapper = shallow(
{renderPercentileSeries}
); - expect(wrapper.find(AreaSeries).prop('yAccessors')).toEqual([ - 'col-1-3.1', - 'col-2-3.5', - 'col-3-3.25', - 'col-4-3.50', - 'col-5-3.75', - 'col-6-3.95', - 'col-7-3.99', - ]); - }); - - it('defaults the CurveType to linear', () => { - const renderSeries = getAllSeries(getVisConfig(), defaultSeriesParams, defaultData); - const wrapper = shallow(
{renderSeries}
); - expect(wrapper.find(AreaSeries).prop('curve')).toEqual(CurveType.LINEAR); - }); -}); diff --git a/src/plugins/vis_types/xy/public/utils/render_all_series.tsx b/src/plugins/vis_types/xy/public/utils/render_all_series.tsx deleted file mode 100644 index 0e3787a27560d..0000000000000 --- a/src/plugins/vis_types/xy/public/utils/render_all_series.tsx +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { - AreaSeries, - CurveType, - BarSeries, - XYChartSeriesIdentifier, - SeriesColorAccessorFn, - SeriesName, - Accessor, - AccessorFn, - ColorVariant, - LabelOverflowConstraint, -} from '@elastic/charts'; - -import { DatatableRow } from '@kbn/expressions-plugin/public'; - -import { ChartType } from '../../common'; -import { SeriesParam, VisConfig, Aspect } from '../types'; -import { isValidSeriesForDimension } from './accessors'; -import { computePercentageData } from './compute_percentage_data'; - -/** - * Matches vislib curve to elastic charts - * @param type curve type - */ -const getCurveType = (type?: 'linear' | 'cardinal' | 'step-after'): CurveType => { - switch (type) { - case 'cardinal': - return CurveType.CURVE_MONOTONE_X; - case 'step-after': - return CurveType.CURVE_STEP_AFTER; - case 'linear': - default: - return CurveType.LINEAR; - } -}; - -/** - * Renders chart Line, Area or Bar series - * @param config - * @param seriesParams - * @param data - * @param getSeriesName - * @param getSeriesColor - */ -export const renderAllSeries = ( - { - aspects, - yAxes, - xAxis, - showValueLabel, - enableHistogramMode, - fittingFunction, - fillOpacity, - }: VisConfig, - seriesParams: SeriesParam[], - data: DatatableRow[], - getSeriesName: (series: XYChartSeriesIdentifier) => SeriesName, - getSeriesColor: SeriesColorAccessorFn, - timeZone: string, - xAccessor: Accessor | AccessorFn, - splitSeriesAccessors: Array -) => { - let percentageModeComputedData: DatatableRow[] = []; - yAxes.forEach((yAxis) => { - const scale = yAxis.scale; - // find the series that are positioned on this axis - const series = seriesParams.filter((seriesParam) => seriesParam.valueAxis === yAxis.groupId); - const yAspects: Aspect[] = []; - series.forEach((seriesParam) => { - const aggId = seriesParam.data.id; - const accessorsInSeries = aspects.y.filter((aspect) => aspect.aggId === aggId); - yAspects.push(...accessorsInSeries); - }); - const yAccessors = yAspects.map((aspect) => { - return aspect.accessor; - }) as string[]; - if (scale.mode === 'percentage') { - const splitChartAccessor = aspects.splitColumn?.accessor || aspects.splitRow?.accessor; - percentageModeComputedData = computePercentageData( - data, - xAccessor, - yAccessors, - splitChartAccessor - ); - } - }); - - return seriesParams.map( - ({ - show, - valueAxis: groupId, - data: { id: paramId }, - lineWidth: strokeWidth, - showCircles, - circlesRadius, - drawLinesBetweenPoints, - mode, - interpolate, - type, - }) => { - const yAspects = aspects.y.filter((aspect) => isValidSeriesForDimension(paramId, aspect)); - if (!show || !yAspects.length) { - return null; - } - const yAccessors = yAspects.map((aspect) => aspect.accessor) as string[]; - - const id = `${type}-${yAccessors[0]}`; - const yAxisScale = yAxes.find(({ groupId: axisGroupId }) => axisGroupId === groupId)?.scale; - - const isStacked = mode === 'stacked'; - - const stackMode = yAxisScale?.mode === 'normal' ? undefined : yAxisScale?.mode; - // needed to seperate stacked and non-stacked bars into unique pseudo groups - const pseudoGroupId = isStacked ? `__pseudo_stacked_group-${groupId}__` : groupId; - // set domain of stacked groups to use actual groupId not pseudo groupdId - const useDefaultGroupDomain = isStacked ? groupId : undefined; - - switch (type) { - case ChartType.Histogram: - return ( - - ); - - case ChartType.Area: - case ChartType.Line: - const markSizeAccessor = showCircles ? aspects.z?.accessor ?? undefined : undefined; - - return ( - - ); - default: - // Error: unsupported chart type - return null; - } - } - ); -}; diff --git a/src/plugins/vis_types/xy/public/vis_component.tsx b/src/plugins/vis_types/xy/public/vis_component.tsx deleted file mode 100644 index a744841601a67..0000000000000 --- a/src/plugins/vis_types/xy/public/vis_component.tsx +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import type { PaletteRegistry } from '@kbn/coloring'; -import { - Chart, - ElementClickListener, - XYChartElementEvent, - Position, - XYChartSeriesIdentifier, - BrushEndListener, - RenderChangeListener, - ScaleType, - AccessorFn, - Accessor, - XYBrushEvent, - Placement, -} from '@elastic/charts'; - -import { compact } from 'lodash'; -import { - getFilterFromChartClickEventFn, - getFilterFromSeriesFn, - LegendToggle, - getBrushFromChartBrushEventFn, - ClickTriggerEvent, - useActiveCursor, -} from '@kbn/charts-plugin/public'; -import { Datatable, IInterpreterRenderHandlers } from '@kbn/expressions-plugin/public'; -import { - DEFAULT_LEGEND_SIZE, - LegendSizeToPixels, - PersistedState, -} from '@kbn/visualizations-plugin/public'; -import { VisParams } from './types'; -import { - getAdjustedDomain, - getXDomain, - getTimeZone, - renderAllSeries, - getSeriesNameFn, - getLegendActions, - getColorPicker, - getXAccessor, - getAllSeries, -} from './utils'; -import { XYAxis, XYEndzones, XYCurrentTime, XYSettings, XYThresholdLine } from './components'; -import { getConfig } from './config'; -import { getThemeService, getDataActions, getPalettesService, getActiveCursor } from './services'; -import { ChartType } from '../common'; - -import './_chart.scss'; -import { - COMPLEX_SPLIT_ACCESSOR, - getComplexAccessor, - getSplitSeriesAccessorFnMap, -} from './utils/accessors'; -import { ChartSplit } from './chart_split'; - -export interface VisComponentProps { - visParams: VisParams; - visData: Datatable; - uiState: PersistedState; - fireEvent: IInterpreterRenderHandlers['event']; - renderComplete: IInterpreterRenderHandlers['done']; - syncColors: boolean; - syncTooltips: boolean; - useLegacyTimeAxis: boolean; -} - -export type VisComponentType = typeof VisComponent; - -const VisComponent = (props: VisComponentProps) => { - const [showLegend, setShowLegend] = useState(() => { - // TODO: Check when this bwc can safely be removed - const bwcLegendStateDefault = - props.visParams.addLegend == null ? true : props.visParams.addLegend; - return props.uiState?.get('vis.legendOpen', bwcLegendStateDefault) as boolean; - }); - const [palettesRegistry, setPalettesRegistry] = useState(null); - const chartRef = useRef(null); - - const handleCursorUpdate = useActiveCursor(getActiveCursor(), chartRef, { - datatables: [props.visData], - }); - - const onRenderChange = useCallback( - (isRendered) => { - if (isRendered) { - props.renderComplete(); - } - }, - [props] - ); - - useEffect(() => { - const fetchPalettes = async () => { - const palettes = await getPalettesService().getPalettes(); - setPalettesRegistry(palettes); - }; - fetchPalettes(); - }, []); - - const handleFilterClick = useCallback( - ( - visData: Datatable, - xAccessor: Accessor | AccessorFn, - splitSeriesAccessors: Array, - splitChartAccessor?: Accessor | AccessorFn - ): ElementClickListener => { - const splitSeriesAccessorFnMap = getSplitSeriesAccessorFnMap(splitSeriesAccessors); - return (elements) => { - if (xAccessor !== null) { - const event = getFilterFromChartClickEventFn( - visData, - xAccessor, - splitSeriesAccessorFnMap, - splitChartAccessor - )(elements as XYChartElementEvent[]); - props.fireEvent(event); - } - }; - }, - [props] - ); - - const handleBrush = useCallback( - ( - visData: Datatable, - xAccessor: Accessor | AccessorFn, - isInterval: boolean - ): BrushEndListener | undefined => { - if (xAccessor !== null && isInterval) { - return (brushArea) => { - const event = getBrushFromChartBrushEventFn( - visData, - xAccessor - )(brushArea as XYBrushEvent); - props.fireEvent(event); - }; - } - }, - [props] - ); - - const getFilterEventData = useCallback( - ( - visData: Datatable, - xAccessor: Accessor | AccessorFn, - splitSeriesAccessors: Array - ) => { - const splitSeriesAccessorFnMap = getSplitSeriesAccessorFnMap(splitSeriesAccessors); - return (series: XYChartSeriesIdentifier): ClickTriggerEvent | null => { - if (xAccessor !== null) { - return getFilterFromSeriesFn(visData)(series, splitSeriesAccessorFnMap); - } - - return null; - }; - }, - [] - ); - - const handleFilterAction = useCallback( - (event: ClickTriggerEvent, negate = false) => { - props.fireEvent({ - ...event, - data: { - ...event.data, - negate, - }, - }); - }, - [props] - ); - - const canFilter = async (event: ClickTriggerEvent | null): Promise => { - if (!event) { - return false; - } - const filters = await getDataActions().createFiltersFromValueClickAction(event.data); - return Boolean(filters.length); - }; - - const toggleLegend = useCallback(() => { - setShowLegend((value) => { - const newValue = !value; - if (props.uiState?.set) { - props.uiState.set('vis.legendOpen', newValue); - } - return newValue; - }); - }, [props.uiState]); - - const setColor = useCallback( - (newColor: string | null, seriesLabel: string | number) => { - const colors = props.uiState?.get('vis.colors') || {}; - if (colors[seriesLabel] === newColor || !newColor) { - delete colors[seriesLabel]; - } else { - colors[seriesLabel] = newColor; - } - - if (props.uiState?.set) { - props.uiState.setSilent('vis.colors', null); - props.uiState.set('vis.colors', colors); - props.uiState.emit('colorChanged'); - } - }, - [props.uiState] - ); - - const { visData, visParams, syncColors, syncTooltips } = props; - const isDarkMode = getThemeService().useDarkMode(); - - const config = getConfig(visData, visParams, props.useLegacyTimeAxis, isDarkMode); - const timeZone = getTimeZone(); - const xDomain = - config.xAxis.scale.type === ScaleType.Ordinal ? undefined : getXDomain(config.aspects.x.params); - const hasBars = visParams.seriesParams.some( - ({ type, data: { id: paramId } }) => - type === ChartType.Histogram && - config.aspects.y.find(({ aggId }) => aggId === paramId) !== undefined - ); - const adjustedXDomain = - config.xAxis.scale.type === ScaleType.Ordinal - ? undefined - : getAdjustedDomain(visData.rows, config.aspects.x, timeZone, xDomain, hasBars); - const legendPosition = useMemo( - () => config.legend.position ?? Position.Right, - [config.legend.position] - ); - - const getSeriesName = getSeriesNameFn(config.aspects, config.aspects.y.length > 1); - - const splitAccessors = config.aspects.series?.map(({ accessor, formatter }) => { - return { accessor, formatter }; - }); - - const allSeries = useMemo( - () => getAllSeries(visData.rows, splitAccessors, config.aspects.y), - [config.aspects.y, splitAccessors, visData.rows] - ); - - const getSeriesColor = useCallback( - (series: XYChartSeriesIdentifier) => { - const seriesName = getSeriesName(series) as string; - if (!seriesName) { - return null; - } - const overwriteColors: Record = props.uiState?.get - ? props.uiState.get('vis.colors', {}) - : {}; - - if (Object.keys(overwriteColors).includes(seriesName)) { - return overwriteColors[seriesName]; - } - const outputColor = palettesRegistry?.get(visParams.palette.name).getCategoricalColor( - [ - { - name: seriesName, - rankAtDepth: splitAccessors - ? allSeries.findIndex((name) => name === seriesName) - : config.aspects.y.findIndex((aspect) => aspect.accessor === series.yAccessor), - totalSeriesAtDepth: splitAccessors ? allSeries.length : config.aspects.y.length, - }, - ], - { - maxDepth: 1, - totalSeries: splitAccessors ? allSeries.length : config.aspects.y.length, - behindText: false, - syncColors, - } - ); - return outputColor || null; - }, - [ - allSeries, - config.aspects.y, - getSeriesName, - props.uiState, - splitAccessors, - syncColors, - visParams.palette.name, - palettesRegistry, - ] - ); - const xAccessor = getXAccessor(config.aspects.x); - - const splitSeriesAccessors = useMemo( - () => - config.aspects.series - ? compact(config.aspects.series.map(getComplexAccessor(COMPLEX_SPLIT_ACCESSOR))) - : [], - [config.aspects.series] - ); - const splitChartColumnAccessor = config.aspects.splitColumn - ? getComplexAccessor(COMPLEX_SPLIT_ACCESSOR, true)(config.aspects.splitColumn) - : undefined; - const splitChartRowAccessor = config.aspects.splitRow - ? getComplexAccessor(COMPLEX_SPLIT_ACCESSOR, true)(config.aspects.splitRow) - : undefined; - - const renderSeries = useMemo( - () => - renderAllSeries( - config, - visParams.seriesParams, - visData.rows, - getSeriesName, - getSeriesColor, - timeZone, - xAccessor, - splitSeriesAccessors - ), - [ - config, - getSeriesColor, - getSeriesName, - splitSeriesAccessors, - timeZone, - visData.rows, - visParams.seriesParams, - xAccessor, - ] - ); - - const legendColorPicker = useMemo( - () => - getColorPicker( - legendPosition, - setColor, - getSeriesName, - visParams.palette.name, - props.uiState - ), - [getSeriesName, legendPosition, props.uiState, setColor, visParams.palette.name] - ); - - return ( -
- - - - 0 - ? getLegendActions( - canFilter, - getFilterEventData(visData, xAccessor, splitSeriesAccessors), - handleFilterAction, - getSeriesName - ) - : undefined - } - /> - - - - - {config.yAxes.map((axisProps) => ( - - ))} - {renderSeries} - -
- ); -}; - -// eslint-disable-next-line import/no-default-export -export default memo(VisComponent); diff --git a/src/plugins/vis_types/xy/public/vis_renderer.tsx b/src/plugins/vis_types/xy/public/vis_renderer.tsx deleted file mode 100644 index 246f85ee60089..0000000000000 --- a/src/plugins/vis_types/xy/public/vis_renderer.tsx +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { lazy } from 'react'; -import { render, unmountComponentAtNode } from 'react-dom'; -import { I18nProvider } from '@kbn/i18n-react'; -import { KibanaExecutionContext } from '@kbn/core-execution-context-common'; - -import { METRIC_TYPE } from '@kbn/analytics'; -import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; -import { VisualizationContainer } from '@kbn/visualizations-plugin/public'; -import type { PersistedState } from '@kbn/visualizations-plugin/public'; -import type { ExpressionRenderDefinition } from '@kbn/expressions-plugin/public'; - -import { LEGACY_TIME_AXIS } from '@kbn/charts-plugin/common'; -import { StartServicesGetter } from '@kbn/kibana-utils-plugin/public'; -import type { XyVisType } from '../common'; -import type { VisComponentType } from './vis_component'; -import { RenderValue, visName } from './expression_functions/xy_vis_fn'; -import { VisTypeXyPluginStartDependencies } from './plugin'; - -// @ts-ignore -const VisComponent = lazy(() => import('./vis_component')); - -function shouldShowNoResultsMessage(visData: any, visType: XyVisType): boolean { - const rows: object[] | undefined = visData?.rows; - const isZeroHits = visData?.hits === 0 || (rows && !rows.length); - - return Boolean(isZeroHits); -} - -/** @internal **/ -const extractContainerType = (context?: KibanaExecutionContext): string | undefined => { - if (context) { - const recursiveGet = (item: KibanaExecutionContext): KibanaExecutionContext | undefined => { - if (item.type) { - return item; - } else if (item.child) { - return recursiveGet(item.child); - } - }; - return recursiveGet(context)?.type; - } -}; - -export const getXYVisRenderer: (deps: { - getStartDeps: StartServicesGetter; -}) => ExpressionRenderDefinition = ({ getStartDeps }) => ({ - name: visName, - displayName: 'XY visualization', - reuseDomNode: true, - render: async (domNode, { visData, visConfig, visType, syncColors, syncTooltips }, handlers) => { - const { core, plugins } = getStartDeps(); - const showNoResult = shouldShowNoResultsMessage(visData, visType); - - const renderComplete = () => { - // Renaming according to business requirements - const visTypeTelemetryMap: Record = { - histogram: 'vertical_bar', - }; - const containerType = extractContainerType(handlers.getExecutionContext()); - const visualizationType = 'agg_based'; - - if (plugins.usageCollection && containerType) { - const hasMixedXY = new Set(visConfig.seriesParams.map((item) => item.type)); - const counterEvents = [ - `render_${visualizationType}_${visTypeTelemetryMap[visType] ?? visType}`, - hasMixedXY.size > 1 ? `render_${visualizationType}_mixed_xy` : undefined, - ].filter(Boolean) as string[]; - - plugins.usageCollection.reportUiCounter(containerType, METRIC_TYPE.COUNT, counterEvents); - } - - handlers.done(); - }; - - handlers.onDestroy(() => unmountComponentAtNode(domNode)); - - render( - - - - - - - , - domNode - ); - }, -}); diff --git a/src/plugins/vis_types/xy/tsconfig.json b/src/plugins/vis_types/xy/tsconfig.json index ab3f3d1252ed8..7cc6e60099cbf 100644 --- a/src/plugins/vis_types/xy/tsconfig.json +++ b/src/plugins/vis_types/xy/tsconfig.json @@ -15,10 +15,7 @@ "references": [ { "path": "../../../core/tsconfig.json" }, { "path": "../../charts/tsconfig.json" }, - { "path": "../../data/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../usage_collection/tsconfig.json" }, { "path": "../../kibana_utils/tsconfig.json" }, { "path": "../../vis_default_editor/tsconfig.json" }, ] diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx b/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx index f0aab3b880ae3..3af553fdd56b7 100644 --- a/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx @@ -192,6 +192,10 @@ export class VisualizeEmbeddable return this.vis.description; } + public getVis() { + return this.vis; + } + /** * Gets the Visualize embeddable's local filters * @returns Local/panel-level array of filters for Visualize embeddable diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx b/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx index 05e7ea218325b..4dcaa582511c3 100644 --- a/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx @@ -25,8 +25,8 @@ import { IContainer, AttributeService, } from '@kbn/embeddable-plugin/public'; -import { checkForDuplicateTitle } from '@kbn/saved-objects-plugin/public'; import type { StartServicesGetter } from '@kbn/kibana-utils-plugin/public'; +import { checkForDuplicateTitle } from '../utils/saved_objects_utils/check_for_duplicate_title'; import type { DisabledLabEmbeddable } from './disabled_lab_embeddable'; import type { VisualizeByReferenceInput, @@ -271,17 +271,18 @@ export class VisualizeEmbeddableFactory } } - public async checkTitle(props: OnSaveProps): Promise { + public async checkTitle(props: OnSaveProps): Promise { const savedObjectsClient = await this.deps.start().core.savedObjects.client; const overlays = await this.deps.start().core.overlays; + return checkForDuplicateTitle( { title: props.newTitle, - copyOnSave: false, lastSavedTitle: '', getEsType: () => this.type, getDisplayName: this.getDisplayName || (() => this.type), }, + false, props.isTitleDuplicateConfirmed, props.onTitleDuplicate, { diff --git a/src/plugins/visualizations/public/index.ts b/src/plugins/visualizations/public/index.ts index 67b13c8236708..78ba1d19a982f 100644 --- a/src/plugins/visualizations/public/index.ts +++ b/src/plugins/visualizations/public/index.ts @@ -37,6 +37,7 @@ export type { Vis, SerializedVis, SerializedVisData, VisData } from './vis'; export type VisualizeEmbeddableFactoryContract = PublicContract; export type VisualizeEmbeddableContract = PublicContract; export type { VisualizeInput } from './embeddable'; +export type { VisualizeEmbeddable } from './embeddable'; export type { SchemaConfig } from './vis_schemas'; export { updateOldState } from './legacy/vis_update_state'; export type { PersistedState } from './persisted_state'; diff --git a/src/plugins/visualizations/public/legacy/vis_update_state.js b/src/plugins/visualizations/public/legacy/vis_update_state.js index db6a9f2beb776..00853a2af8c6e 100644 --- a/src/plugins/visualizations/public/legacy/vis_update_state.js +++ b/src/plugins/visualizations/public/legacy/vis_update_state.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; /** diff --git a/src/plugins/visualizations/public/persisted_state/persisted_state.ts b/src/plugins/visualizations/public/persisted_state/persisted_state.ts index dcc86228031fa..74b23081c4ace 100644 --- a/src/plugins/visualizations/public/persisted_state/persisted_state.ts +++ b/src/plugins/visualizations/public/persisted_state/persisted_state.ts @@ -8,7 +8,7 @@ import { EventEmitter } from 'events'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { isPlainObject, cloneDeep, get, isEqual, isString, merge, mergeWith, toPath } from 'lodash'; function prepSetParams(key: PersistedStateKey, value: any, path: PersistedStatePath) { diff --git a/src/plugins/visualizations/public/types.ts b/src/plugins/visualizations/public/types.ts index 8c09258f83546..c69f7894fa326 100644 --- a/src/plugins/visualizations/public/types.ts +++ b/src/plugins/visualizations/public/types.ts @@ -48,7 +48,7 @@ export interface ISavedVis { export interface VisSavedObject extends ISavedVis { lastSavedTitle: string; getEsType: () => string; - getDisplayName?: () => string; + getDisplayName: () => string; displayName: string; migrationVersion?: SavedObjectsMigrationVersion; searchSource?: ISearchSource; diff --git a/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts b/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts index 3dc876a7e32e7..e4a006212d767 100644 --- a/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts +++ b/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts @@ -7,13 +7,13 @@ */ import type { OverlayStart, SavedObjectsClientContract } from '@kbn/core/public'; -import type { SavedObject } from '@kbn/saved-objects-plugin/public'; +import type { VisSavedObject } from '../../types'; import { SAVE_DUPLICATE_REJECTED } from './constants'; import { findObjectByTitle } from './find_object_by_title'; import { displayDuplicateTitleConfirmModal } from './display_duplicate_title_confirm_modal'; /** - * check for an existing SavedObject with the same title in ES + * check for an existing VisSavedObject with the same title in ES * returns Promise when it's no duplicate, or the modal displaying the warning * that's there's a duplicate is confirmed, else it returns a rejected Promise * @param savedObject @@ -23,16 +23,17 @@ import { displayDuplicateTitleConfirmModal } from './display_duplicate_title_con */ export async function checkForDuplicateTitle( savedObject: Pick< - SavedObject, - 'id' | 'title' | 'getDisplayName' | 'lastSavedTitle' | 'copyOnSave' | 'getEsType' + VisSavedObject, + 'id' | 'title' | 'lastSavedTitle' | 'getDisplayName' | 'getEsType' >, + copyOnSave: boolean, isTitleDuplicateConfirmed: boolean, onTitleDuplicate: (() => void) | undefined, services: { savedObjectsClient: SavedObjectsClientContract; overlays: OverlayStart; } -): Promise { +): Promise { const { savedObjectsClient, overlays } = services; // Don't check for duplicates if user has already confirmed save with duplicate title if (isTitleDuplicateConfirmed) { @@ -41,7 +42,7 @@ export async function checkForDuplicateTitle( // Don't check if the user isn't updating the title, otherwise that would become very annoying to have // to confirm the save every time, except when copyOnSave is true, then we do want to check. - if (savedObject.title === savedObject.lastSavedTitle && !savedObject.copyOnSave) { + if (savedObject.title === savedObject.lastSavedTitle && !copyOnSave) { return true; } diff --git a/src/plugins/visualizations/public/utils/saved_objects_utils/confirm_modal_promise.tsx b/src/plugins/visualizations/public/utils/saved_objects_utils/confirm_modal_promise.tsx index 66395d4b3722e..4e8bc7b9e7228 100644 --- a/src/plugins/visualizations/public/utils/saved_objects_utils/confirm_modal_promise.tsx +++ b/src/plugins/visualizations/public/utils/saved_objects_utils/confirm_modal_promise.tsx @@ -17,7 +17,7 @@ export function confirmModalPromise( title = '', confirmBtnText = '', overlays: OverlayStart -): Promise { +): Promise { return new Promise((resolve, reject) => { const cancelButtonText = i18n.translate('visualizations.confirmModal.cancelButtonLabel', { defaultMessage: 'Cancel', diff --git a/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts b/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts index 9291b2a29e0a0..4ce7f2ec33e40 100644 --- a/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts +++ b/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts @@ -8,14 +8,14 @@ import { i18n } from '@kbn/i18n'; import type { OverlayStart } from '@kbn/core/public'; -import type { SavedObject } from '@kbn/saved-objects-plugin/public'; +import type { VisSavedObject } from '../../types'; import { SAVE_DUPLICATE_REJECTED } from './constants'; import { confirmModalPromise } from './confirm_modal_promise'; export function displayDuplicateTitleConfirmModal( - savedObject: Pick, + savedObject: Pick, overlays: OverlayStart -): Promise { +): Promise { const confirmMessage = i18n.translate( 'visualizations.confirmModal.saveDuplicateConfirmationMessage', { diff --git a/src/plugins/visualizations/public/utils/saved_objects_utils/find_object_by_title.test.ts b/src/plugins/visualizations/public/utils/saved_objects_utils/find_object_by_title.test.ts index 8c8bda93ce13e..91ccf9262df95 100644 --- a/src/plugins/visualizations/public/utils/saved_objects_utils/find_object_by_title.test.ts +++ b/src/plugins/visualizations/public/utils/saved_objects_utils/find_object_by_title.test.ts @@ -7,7 +7,7 @@ */ import { findObjectByTitle } from './find_object_by_title'; -import { SavedObjectsClientContract, SavedObject } from '@kbn/core/public'; +import { SavedObjectsClientContract, SimpleSavedObject } from '@kbn/core/public'; import { simpleSavedObjectMock } from '@kbn/core/public/mocks'; describe('findObjectByTitle', () => { @@ -25,7 +25,8 @@ describe('findObjectByTitle', () => { it('matches any case', async () => { const indexPattern = simpleSavedObjectMock.create(savedObjectsClient, { attributes: { title: 'foo' }, - } as SavedObject); + } as SimpleSavedObject); + savedObjectsClient.find = jest.fn().mockImplementation(() => Promise.resolve({ savedObjects: [indexPattern], diff --git a/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.test.ts b/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.test.ts index fc5581eb3ed05..05512a421c28d 100644 --- a/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.test.ts +++ b/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.test.ts @@ -13,6 +13,7 @@ import type { } from '@kbn/core/public'; import type { SavedObjectsClientContract } from '@kbn/core/public'; import { saveWithConfirmation } from './save_with_confirmation'; +import { VisSavedObject } from '../../types'; import * as deps from './confirm_modal_promise'; import { OVERWRITE_REJECTED } from './constants'; @@ -25,7 +26,7 @@ describe('saveWithConfirmation', () => { getEsType: () => 'test type', title: 'test title', displayName: 'test display name', - }; + } as VisSavedObject; beforeEach(() => { savedObjectsClient.create = jest.fn(); diff --git a/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.ts b/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.ts index a33fbd18f1b4f..ea46095d589bf 100644 --- a/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.ts +++ b/src/plugins/visualizations/public/utils/saved_objects_utils/save_with_confirmation.ts @@ -16,27 +16,24 @@ import type { } from '@kbn/core/public'; import { OVERWRITE_REJECTED } from './constants'; import { confirmModalPromise } from './confirm_modal_promise'; +import type { VisSavedObject } from '../../types'; /** * Attempts to create the current object using the serialized source. If an object already * exists, a warning message requests an overwrite confirmation. * @param source - serialized version of this object what will be indexed into elasticsearch. - * @param savedObject - a simple object that contains properties title and displayName, and getEsType method + * @param savedObject - VisSavedObject * @param options - options to pass to the saved object create method * @param services - provides Kibana services savedObjectsClient and overlays * @returns {Promise} - A promise that is resolved with the objects id if the object is * successfully indexed. If the overwrite confirmation was rejected, an error is thrown with * a confirmRejected = true parameter so that case can be handled differently than * a create or index error. - * @resolved {SavedObject} + * @resolved {SimpleSavedObject} */ export async function saveWithConfirmation( source: SavedObjectAttributes, - savedObject: { - getEsType(): string; - title: string; - displayName: string; - }, + savedObject: VisSavedObject, options: SavedObjectsCreateOptions, services: { savedObjectsClient: SavedObjectsClientContract; overlays: OverlayStart } ) { diff --git a/src/plugins/visualizations/public/utils/saved_visualize_utils.ts b/src/plugins/visualizations/public/utils/saved_visualize_utils.ts index df7565827dd9f..2238ff7cf054a 100644 --- a/src/plugins/visualizations/public/utils/saved_visualize_utils.ts +++ b/src/plugins/visualizations/public/utils/saved_visualize_utils.ts @@ -370,10 +370,8 @@ export async function saveVisualization( try { await checkForDuplicateTitle( - { - ...savedObject, - copyOnSave, - } as any, + savedObject, + copyOnSave, isTitleDuplicateConfirmed, onTitleDuplicate, services as any diff --git a/src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx b/src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx index 59017aa643cc7..d3c2c75bca853 100644 --- a/src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx +++ b/src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx @@ -34,6 +34,7 @@ import { getTableColumns, getNoItemsMessage } from '../utils'; export const VisualizeListing = () => { const { services: { + core, application, executionContext, chrome, @@ -108,8 +109,8 @@ export const VisualizeListing = () => { const noItemsFragment = useMemo(() => getNoItemsMessage(createNewVis), [createNewVis]); const tableColumns = useMemo( - () => getTableColumns(application, kbnUrlStateStorage, savedObjectsTagging), - [application, kbnUrlStateStorage, savedObjectsTagging] + () => getTableColumns(core, kbnUrlStateStorage, savedObjectsTagging), + [core, kbnUrlStateStorage, savedObjectsTagging] ); const fetchItems = useCallback( diff --git a/src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx b/src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx index 03cb64920879e..adb9e3d9ef3e9 100644 --- a/src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx +++ b/src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx @@ -18,10 +18,10 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { ApplicationStart } from '@kbn/core/public'; import { IKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; import type { SavedObjectsTaggingApi } from '@kbn/saved-objects-tagging-oss-plugin/public'; -import { RedirectAppLinks } from '@kbn/kibana-react-plugin/public'; +import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; +import type { CoreStart } from '@kbn/core/public'; import { VisualizationListItem } from '../..'; import { getVisualizeListItemLink } from './get_visualize_list_item_link'; @@ -80,7 +80,7 @@ const renderItemTypeIcon = (item: VisualizationListItem) => { }; export const getTableColumns = ( - application: ApplicationStart, + core: CoreStart, kbnUrlStateStorage: IKbnUrlStateStorage, taggingApi?: SavedObjectsTaggingApi ) => @@ -91,12 +91,17 @@ export const getTableColumns = ( defaultMessage: 'Title', }), sortable: true, - render: (field: string, { editApp, editUrl, title, error, type }: VisualizationListItem) => + render: (field: string, { editApp, editUrl, title, error }: VisualizationListItem) => // In case an error occurs i.e. the vis has wrong type, we render the vis but without the link !error ? ( - + {field} diff --git a/test/api_integration/apis/telemetry/utils/schema_to_config_schema.ts b/test/api_integration/apis/telemetry/utils/schema_to_config_schema.ts index deb6218e145af..b80a42e101284 100644 --- a/test/api_integration/apis/telemetry/utils/schema_to_config_schema.ts +++ b/test/api_integration/apis/telemetry/utils/schema_to_config_schema.ts @@ -8,7 +8,7 @@ import type { ObjectType, Type } from '@kbn/config-schema'; import { schema } from '@kbn/config-schema'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get, merge } from 'lodash'; import type { AllowedSchemaTypes } from '@kbn/usage-collection-plugin/server'; diff --git a/test/functional/apps/management/ccs_compatibility/_data_views_ccs.ts b/test/functional/apps/management/ccs_compatibility/_data_views_ccs.ts new file mode 100644 index 0000000000000..d2ab2b64bf738 --- /dev/null +++ b/test/functional/apps/management/ccs_compatibility/_data_views_ccs.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const kibanaServer = getService('kibanaServer'); + const testSubjects = getService('testSubjects'); + const es = getService('es'); + const PageObjects = getPageObjects(['settings', 'common', 'header']); + const security = getService('security'); + + describe('data views ccs', function () { + before(async function () { + await security.testUser.setRoles(['kibana_admin']); + }); + + describe('index pattern wizard ccs', () => { + describe('remote cluster only', async () => { + beforeEach(async function () { + await kibanaServer.uiSettings.replace({}); + await PageObjects.settings.navigateTo(); + await PageObjects.settings.clickKibanaIndexPatterns(); + }); + it('create index pattern using remote name', async () => { + await PageObjects.settings.createIndexPattern('ftr-remote:logstash*', null); + await PageObjects.settings.clickKibanaIndexPatterns(); + const indexPatternList = await PageObjects.settings.getIndexPatternList(); + expect(indexPatternList.length).to.eql(1); + }); + it('create index pattern with wildcards in remote name', async () => { + await PageObjects.settings.createIndexPattern('*t*-remo*:log*', null); + await PageObjects.settings.clickKibanaIndexPatterns(); + const indexPatternList = await PageObjects.settings.getIndexPatternList(); + expect(indexPatternList.length).to.eql(1); + }); + + afterEach(async () => { + await PageObjects.header.waitUntilLoadingHasFinished(); + await testSubjects.exists('indexPatternTable'); + await kibanaServer.savedObjects.cleanStandardList(); + }); + }); + describe('remote and local clusters', async () => { + before(async () => { + await es.transport.request({ + path: '/blogs/_doc', + method: 'POST', + body: { user: 'cuffs', message: 20 }, + }); + }); + + beforeEach(async function () { + // delete .kibana index and then wait for Kibana to re-create it + await kibanaServer.uiSettings.replace({}); + await PageObjects.settings.navigateTo(); + await PageObjects.settings.clickKibanaIndexPatterns(); + }); + it('combined remote cluster and local cluster data view without wildcards', async () => { + await PageObjects.settings.createIndexPattern('blog*, ftr-remote:log*', null); + await PageObjects.settings.clickKibanaIndexPatterns(); + const indexPatternList = await PageObjects.settings.getIndexPatternList(); + expect(indexPatternList.length).to.eql(1); + }); + it('combined remote cluster and local cluster data view with wildcards', async () => { + await PageObjects.settings.createIndexPattern('blog*, *t*-remo*:lo*', null); + await PageObjects.settings.clickKibanaIndexPatterns(); + const indexPatternList = await PageObjects.settings.getIndexPatternList(); + expect(indexPatternList.length).to.eql(1); + }); + + afterEach(async () => { + await PageObjects.header.waitUntilLoadingHasFinished(); + await testSubjects.exists('indexPatternTable'); + await kibanaServer.savedObjects.cleanStandardList(); + }); + after(async () => { + await es.transport.request({ + path: '/blogs', + method: 'DELETE', + }); + }); + }); + after(async () => { + await security.testUser.restoreDefaults(); + }); + }); + }); +} diff --git a/test/functional/apps/management/ccs_compatibility/index.ts b/test/functional/apps/management/ccs_compatibility/index.ts new file mode 100644 index 0000000000000..14c0c90e7b951 --- /dev/null +++ b/test/functional/apps/management/ccs_compatibility/index.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 { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ getService, loadTestFile }: FtrProviderContext) { + const remoteEsArchiver = getService('remoteEsArchiver' as 'esArchiver'); + const esArchiver = getService('esArchiver'); + + describe('management', function () { + before(async () => { + await remoteEsArchiver.loadIfNeeded( + 'test/functional/fixtures/es_archiver/logstash_functional' + ); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/makelogs'); + }); + + after(async () => { + await remoteEsArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.unload('test/functional/fixtures/es_archiver/makelogs'); + }); + + loadTestFile(require.resolve('./_data_views_ccs')); + }); +} diff --git a/test/functional/config.ccs.ts b/test/functional/config.ccs.ts index 6e3f92ac37b8e..c5c303cdf22c5 100644 --- a/test/functional/config.ccs.ts +++ b/test/functional/config.ccs.ts @@ -21,6 +21,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { require.resolve('./apps/dashboard/group3'), require.resolve('./apps/discover/ccs_compatibility'), require.resolve('./apps/console/_console_ccs'), + require.resolve('./apps/management/ccs_compatibility'), ], services: { diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index 8700cc734d809..ab453fc2378ed 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -505,6 +505,15 @@ export class DiscoverPageObject extends FtrService { await this.header.waitUntilLoadingHasFinished(); } + public async getIndexPatterns() { + await this.testSubjects.click('discover-dataView-switch-link'); + const indexPatternSwitcher = await this.testSubjects.find('indexPattern-switcher'); + const li = await indexPatternSwitcher.findAllByTagName('li'); + const items = await Promise.all(li.map((lis) => lis.getVisibleText())); + await this.testSubjects.click('discover-dataView-switch-link'); + return items; + } + public async selectTextBaseLang(lang: 'SQL') { await this.testSubjects.click('discover-dataView-switch-link'); await this.find.clickByCssSelector( diff --git a/test/functional/services/filter_bar.ts b/test/functional/services/filter_bar.ts index ab020a1ae943d..16ce34d446d1c 100644 --- a/test/functional/services/filter_bar.ts +++ b/test/functional/services/filter_bar.ts @@ -56,8 +56,10 @@ export class FilterBarService extends FtrService { * @param key field name */ public async removeFilter(key: string): Promise { - await this.testSubjects.click(`~filter & ~filter-key-${key}`); - await this.testSubjects.click(`deleteFilter`); + await this.retry.try(async () => { + await this.testSubjects.click(`~filter & ~filter-key-${key}`); + await this.testSubjects.click(`deleteFilter`); + }); await this.header.awaitGlobalLoadingIndicatorHidden(); } diff --git a/tsconfig.base.json b/tsconfig.base.json index 36988b9e4e9f0..68882faec661a 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -151,8 +151,6 @@ "@kbn/screenshot-mode-plugin/*": ["src/plugins/screenshot_mode/*"], "@kbn/share-plugin": ["src/plugins/share"], "@kbn/share-plugin/*": ["src/plugins/share/*"], - "@kbn/shared-ux-plugin": ["src/plugins/shared_ux"], - "@kbn/shared-ux-plugin/*": ["src/plugins/shared_ux/*"], "@kbn/telemetry-collection-manager-plugin": ["src/plugins/telemetry_collection_manager"], "@kbn/telemetry-collection-manager-plugin/*": ["src/plugins/telemetry_collection_manager/*"], "@kbn/telemetry-management-section-plugin": ["src/plugins/telemetry_management_section"], diff --git a/x-pack/packages/ml/aiops_components/src/dual_brush/dual_brush.tsx b/x-pack/packages/ml/aiops_components/src/dual_brush/dual_brush.tsx index c593da55ffded..7dc3274c73228 100644 --- a/x-pack/packages/ml/aiops_components/src/dual_brush/dual_brush.tsx +++ b/x-pack/packages/ml/aiops_components/src/dual_brush/dual_brush.tsx @@ -234,6 +234,10 @@ export function DualBrush({ .attr('id', (b: DualBrush) => { return 'aiops-brush-' + b.id; }) + .attr('data-test-subj', (b: DualBrush) => { + // Uppercase the first character of the `id` so we get aiopsBrushBaseline/aiopsBrushDeviation. + return 'aiopsBrush' + b.id.charAt(0).toUpperCase() + b.id.slice(1); + }) .each((brushObject: DualBrush, i, n) => { const x = d3.scaleLinear().domain([min, max]).rangeRound([0, widthRef.current]); brushObject.brush(d3.select(n[i])); @@ -314,6 +318,7 @@ export function DualBrush({ {width > 0 && ( {!isRunning && ( )} {isRunning && ( - - + + )} diff --git a/x-pack/plugins/actions/jest.integration.config.js b/x-pack/plugins/actions/jest.integration.config.js new file mode 100644 index 0000000000000..41bd46b12005e --- /dev/null +++ b/x-pack/plugins/actions/jest.integration.config.js @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +module.exports = { + preset: '@kbn/test/jest_integration_node', + rootDir: '../../..', + roots: ['/x-pack/plugins/actions'], +}; diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/axios_utils_connection.test.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/axios_utils_connection.test.ts deleted file mode 100644 index d5daa33cbb47c..0000000000000 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/axios_utils_connection.test.ts +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { readFileSync as fsReadFileSync } from 'fs'; -import { resolve as pathResolve, join as pathJoin } from 'path'; -import http from 'http'; -import https from 'https'; -import axios from 'axios'; -import { duration as momentDuration } from 'moment'; -import { schema } from '@kbn/config-schema'; - -import { request } from './axios_utils'; -import { ByteSizeValue } from '@kbn/config-schema'; -import { Logger } from '@kbn/core/server'; -import { loggingSystemMock } from '@kbn/core/server/mocks'; -import { createReadySignal } from '@kbn/event-log-plugin/server/lib/ready_signal'; -import { ActionsConfig } from '../../config'; -import { - ActionsConfigurationUtilities, - getActionsConfigurationUtilities, -} from '../../actions_config'; - -const logger = loggingSystemMock.create().get() as jest.Mocked; - -const CERT_DIR = '../../../../../../../packages/kbn-dev-utils/certs'; - -const KIBANA_CRT_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'kibana.crt')); -const KIBANA_KEY_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'kibana.key')); -const CA_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'ca.crt')); - -const KIBANA_KEY = fsReadFileSync(KIBANA_KEY_FILE, 'utf8'); -const KIBANA_CRT = fsReadFileSync(KIBANA_CRT_FILE, 'utf8'); -const CA = fsReadFileSync(CA_FILE, 'utf8'); - -describe('axios connections', () => { - let testServer: http.Server | https.Server; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let savedAxiosDefaultsAdapter: any; - - beforeAll(() => { - // needed to prevent the dreaded Error: Cross origin http://localhost forbidden - // see: https://github.com/axios/axios/issues/1754#issuecomment-572778305 - savedAxiosDefaultsAdapter = axios.defaults.adapter; - axios.defaults.adapter = require('axios/lib/adapters/http'); - }); - - afterAll(() => { - axios.defaults.adapter = savedAxiosDefaultsAdapter; - }); - - beforeEach(() => { - jest.resetAllMocks(); - }); - - afterEach(() => { - testServer.close(); - }); - - describe('http', () => { - test('it works', async () => { - const { url, server } = await createServer(); - testServer = server; - - const configurationUtilities = getACUfromConfig(); - const res = await request({ axios, url, logger, configurationUtilities }); - expect(res.status).toBe(200); - }); - }); - - describe('https', () => { - test('it fails with self-signed cert and no overrides', async () => { - const { url, server } = await createServer(true); - testServer = server; - - const configurationUtilities = getACUfromConfig(); - const fn = async () => await request({ axios, url, logger, configurationUtilities }); - await expect(fn()).rejects.toThrow('certificate'); - }); - - test('it works with verificationMode "none" config', async () => { - const { url, server } = await createServer(true); - testServer = server; - - const configurationUtilities = getACUfromConfig({ - ssl: { - verificationMode: 'none', - }, - }); - const res = await request({ axios, url, logger, configurationUtilities }); - expect(res.status).toBe(200); - }); - - test('it works with verificationMode "none" for custom host config', async () => { - const { url, server } = await createServer(true); - testServer = server; - - const configurationUtilities = getACUfromConfig({ - customHostSettings: [{ url, ssl: { verificationMode: 'none' } }], - }); - const res = await request({ axios, url, logger, configurationUtilities }); - expect(res.status).toBe(200); - }); - - test('it works with ca in custom host config', async () => { - const { url, server } = await createServer(true); - testServer = server; - - const configurationUtilities = getACUfromConfig({ - customHostSettings: [{ url, ssl: { certificateAuthoritiesData: CA } }], - }); - const res = await request({ axios, url, logger, configurationUtilities }); - expect(res.status).toBe(200); - }); - - test('it fails with incorrect ca in custom host config', async () => { - const { url, server } = await createServer(true); - testServer = server; - - const configurationUtilities = getACUfromConfig({ - customHostSettings: [{ url, ssl: { certificateAuthoritiesData: KIBANA_CRT } }], - }); - const fn = async () => await request({ axios, url, logger, configurationUtilities }); - await expect(fn()).rejects.toThrow('certificate'); - }); - - test('it works with incorrect ca in custom host config but verificationMode "none"', async () => { - const { url, server } = await createServer(true); - testServer = server; - - const configurationUtilities = getACUfromConfig({ - customHostSettings: [ - { - url, - ssl: { - certificateAuthoritiesData: CA, - verificationMode: 'none', - }, - }, - ], - }); - const res = await request({ axios, url, logger, configurationUtilities }); - expect(res.status).toBe(200); - }); - - test('it works with incorrect ca in custom host config but verificationMode config "full"', async () => { - const { url, server } = await createServer(true); - testServer = server; - - const configurationUtilities = getACUfromConfig({ - ssl: { - verificationMode: 'none', - }, - customHostSettings: [ - { - url, - ssl: { - certificateAuthoritiesData: CA, - }, - }, - ], - }); - const res = await request({ axios, url, logger, configurationUtilities }); - expect(res.status).toBe(200); - }); - - test('it fails with no matching custom host settings', async () => { - const { url, server } = await createServer(true); - const otherUrl = 'https://example.com'; - testServer = server; - - const configurationUtilities = getACUfromConfig({ - customHostSettings: [{ url: otherUrl, ssl: { verificationMode: 'none' } }], - }); - const fn = async () => await request({ axios, url, logger, configurationUtilities }); - await expect(fn()).rejects.toThrow('certificate'); - }); - - test('it fails cleanly with a garbage CA 1', async () => { - const { url, server } = await createServer(true); - testServer = server; - - const configurationUtilities = getACUfromConfig({ - customHostSettings: [{ url, ssl: { certificateAuthoritiesData: 'garbage' } }], - }); - const fn = async () => await request({ axios, url, logger, configurationUtilities }); - await expect(fn()).rejects.toThrow('certificate'); - }); - - test('it fails cleanly with a garbage CA 2', async () => { - const { url, server } = await createServer(true); - testServer = server; - - const ca = '-----BEGIN CERTIFICATE-----\ngarbage\n-----END CERTIFICATE-----\n'; - const configurationUtilities = getACUfromConfig({ - customHostSettings: [{ url, ssl: { certificateAuthoritiesData: ca } }], - }); - const fn = async () => await request({ axios, url, logger, configurationUtilities }); - await expect(fn()).rejects.toThrow('certificate'); - }); - }); -}); - -interface CreateServerResult { - url: string; - server: http.Server | https.Server; -} - -async function createServer(useHttps: boolean = false): Promise { - let server: http.Server | https.Server; - const readySignal = createReadySignal(); - - if (!useHttps) { - server = http.createServer((req, res) => { - res.writeHead(200); - res.end('http: just testing that a connection could be made'); - }); - } else { - const httpsOptions = { - cert: KIBANA_CRT, - key: KIBANA_KEY, - }; - server = https.createServer(httpsOptions, (req, res) => { - res.writeHead(200); - res.end('https: just testing that a connection could be made'); - }); - } - - server.listen(() => { - const addressInfo = server.address(); - if (addressInfo == null || typeof addressInfo === 'string') { - server.close(); - throw new Error('error getting address of server, closing'); - } - - const url = localUrlFromPort(useHttps, addressInfo.port, 'localhost'); - readySignal.signal({ server, url }); - }); - - // let the node process stop if for some reason this server isn't closed - server.unref(); - - return readySignal.wait(); -} - -const BaseActionsConfig: ActionsConfig = { - allowedHosts: ['*'], - enabledActionTypes: ['*'], - preconfiguredAlertHistoryEsIndex: false, - preconfigured: {}, - proxyUrl: undefined, - proxyHeaders: undefined, - proxyRejectUnauthorizedCertificates: true, - ssl: { - proxyVerificationMode: 'full', - verificationMode: 'full', - }, - proxyBypassHosts: undefined, - proxyOnlyHosts: undefined, - rejectUnauthorized: true, - maxResponseContentLength: ByteSizeValue.parse('1mb'), - responseTimeout: momentDuration(1000 * 30), - customHostSettings: undefined, - cleanupFailedExecutionsTask: { - enabled: true, - cleanupInterval: schema.duration().validate('5m'), - idleInterval: schema.duration().validate('1h'), - pageSize: 100, - }, -}; - -function getACUfromConfig(config: Partial = {}): ActionsConfigurationUtilities { - return getActionsConfigurationUtilities({ - ...BaseActionsConfig, - ...config, - }); -} - -function localUrlFromPort(useHttps: boolean, port: number, host: string): string { - return `${useHttps ? 'https' : 'http'}://${host}:${port}`; -} diff --git a/x-pack/plugins/actions/server/integration_tests/axios_utils_connection.test.ts b/x-pack/plugins/actions/server/integration_tests/axios_utils_connection.test.ts new file mode 100644 index 0000000000000..2b5a137ed0bcc --- /dev/null +++ b/x-pack/plugins/actions/server/integration_tests/axios_utils_connection.test.ts @@ -0,0 +1,595 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor 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 @typescript-eslint/no-var-requires +const proxySetup = require('proxy'); + +import { readFileSync as fsReadFileSync } from 'fs'; +import { resolve as pathResolve, join as pathJoin } from 'path'; +import http from 'http'; +import https from 'https'; +import axios from 'axios'; +import { duration as momentDuration } from 'moment'; +import { schema } from '@kbn/config-schema'; +import getPort from 'get-port'; + +import { request } from '../builtin_action_types/lib/axios_utils'; +import { ByteSizeValue } from '@kbn/config-schema'; +import { Logger } from '@kbn/core/server'; +import { loggingSystemMock } from '@kbn/core/server/mocks'; +import { createReadySignal } from '@kbn/event-log-plugin/server/lib/ready_signal'; +import { ActionsConfig } from '../config'; +import { ActionsConfigurationUtilities, getActionsConfigurationUtilities } from '../actions_config'; +import { resolveCustomHosts } from '../lib/custom_host_settings'; + +const logger = loggingSystemMock.create().get() as jest.Mocked; + +const CERT_DIR = '../../../../../../packages/kbn-dev-utils/certs'; + +const KIBANA_CRT_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'kibana.crt')); +const KIBANA_KEY_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'kibana.key')); +const CA_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'ca.crt')); + +const KIBANA_KEY = fsReadFileSync(KIBANA_KEY_FILE, 'utf8'); +const KIBANA_CRT = fsReadFileSync(KIBANA_CRT_FILE, 'utf8'); +const CA = fsReadFileSync(CA_FILE, 'utf8'); + +const Auth = 'elastic:changeme'; +const AuthB64 = Buffer.from(Auth).toString('base64'); + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const AxiosDefaultsAadapter = require('axios/lib/adapters/http'); + +describe('axios connections', () => { + let testServer: http.Server | https.Server | null; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let savedAxiosDefaultsAdapter: any; + + beforeEach(() => { + // needed to prevent the dreaded Error: Cross origin http://localhost forbidden + // see: https://github.com/axios/axios/issues/1754#issuecomment-572778305 + savedAxiosDefaultsAdapter = axios.defaults.adapter; + axios.defaults.adapter = AxiosDefaultsAadapter; + }); + + afterEach(() => { + axios.defaults.adapter = savedAxiosDefaultsAdapter; + }); + + beforeEach(() => { + jest.resetAllMocks(); + }); + + afterEach(() => { + testServer?.close(); + testServer = null; + }); + + describe('http', () => { + test('it works', async () => { + const { url, server } = await createServer({ useHttps: false }); + testServer = server; + + const configurationUtilities = getACUfromConfig(); + const res = await request({ axios, url, logger, configurationUtilities }); + expect(res.status).toBe(200); + }); + }); + + describe('https', () => { + test('it fails with self-signed cert and no overrides', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig(); + const fn = async () => await request({ axios, url, logger, configurationUtilities }); + await expect(fn()).rejects.toThrow('certificate'); + }); + + test('it works with verificationMode "none" config', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + ssl: { + verificationMode: 'none', + }, + }); + const res = await request({ axios, url, logger, configurationUtilities }); + expect(res.status).toBe(200); + }); + + test('it works with verificationMode "none" for custom host config', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + customHostSettings: [{ url, ssl: { verificationMode: 'none' } }], + }); + const res = await request({ axios, url, logger, configurationUtilities }); + expect(res.status).toBe(200); + }); + + test('it works with ca in custom host config', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + customHostSettings: [{ url, ssl: { certificateAuthoritiesData: CA } }], + }); + const res = await request({ axios, url, logger, configurationUtilities }); + expect(res.status).toBe(200); + }); + + test('it fails with incorrect ca in custom host config', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + customHostSettings: [{ url, ssl: { certificateAuthoritiesData: KIBANA_CRT } }], + }); + const fn = async () => await request({ axios, url, logger, configurationUtilities }); + await expect(fn()).rejects.toThrow('certificate'); + }); + + test('it works with incorrect ca in custom host config but verificationMode "none"', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + customHostSettings: [ + { + url, + ssl: { + certificateAuthoritiesData: CA, + verificationMode: 'none', + }, + }, + ], + }); + const res = await request({ axios, url, logger, configurationUtilities }); + expect(res.status).toBe(200); + }); + + test('it works with incorrect ca in custom host config but verificationMode config "full"', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + ssl: { + verificationMode: 'none', + }, + customHostSettings: [ + { + url, + ssl: { + certificateAuthoritiesData: CA, + }, + }, + ], + }); + const res = await request({ axios, url, logger, configurationUtilities }); + expect(res.status).toBe(200); + }); + + test('it fails with no matching custom host settings', async () => { + const { url, server } = await createServer({ useHttps: true }); + const otherUrl = 'https://example.com'; + testServer = server; + + const configurationUtilities = getACUfromConfig({ + customHostSettings: [{ url: otherUrl, ssl: { verificationMode: 'none' } }], + }); + const fn = async () => await request({ axios, url, logger, configurationUtilities }); + await expect(fn()).rejects.toThrow('certificate'); + }); + + test('it fails cleanly with a garbage CA 1', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + customHostSettings: [{ url, ssl: { certificateAuthoritiesData: 'garbage' } }], + }); + const fn = async () => await request({ axios, url, logger, configurationUtilities }); + await expect(fn()).rejects.toThrow('certificate'); + }); + + test('it fails cleanly with a garbage CA 2', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const ca = '-----BEGIN CERTIFICATE-----\ngarbage\n-----END CERTIFICATE-----\n'; + const configurationUtilities = getACUfromConfig({ + customHostSettings: [{ url, ssl: { certificateAuthoritiesData: ca } }], + }); + const fn = async () => await request({ axios, url, logger, configurationUtilities }); + await expect(fn()).rejects.toThrow('certificate'); + }); + }); + + // targetHttps, proxyHttps, and proxyAuth should all range over [false, true], but + // currently the true versions are not passing + describe(`proxy`, () => { + for (const targetHttps of [false]) { + for (const targetAuth of [false, true]) { + for (const proxyHttps of [false]) { + for (const proxyAuth of [false]) { + const targetLabel = testLabel('target', targetHttps, targetAuth); + const proxyLabel = testLabel('proxy', proxyHttps, proxyAuth); + const testName = `${targetLabel} :: ${proxyLabel}`; + + const opts = { targetHttps, targetAuth, proxyHttps, proxyAuth }; + + test(`basic; ${testName}`, async () => await basicProxyTest(opts)); + + if (targetAuth) { + test(`wrong target password; ${testName}`, async () => + await wrongTargetPasswordProxyTest(opts)); + + test(`missing target password; ${testName}`, async () => + await missingTargetPasswordProxyTest(opts)); + } + + if (proxyAuth) { + test(`wrong proxy password; ${testName}`, async () => + await wrongProxyPasswordProxyTest(opts)); + + test(`missing proxy password; ${testName}`, async () => + await missingProxyPasswordProxyTest(opts)); + } + + if (targetHttps) { + test(`missing CA; ${testName}`, async () => + await missingCaProxyTest(opts)); + + test(`rejectUnauthorized target; ${testName}`, async () => + await rejectUnauthorizedTargetProxyTest(opts)); + + test(`custom CA target; ${testName}`, async () => + await customCAProxyTest(opts)); + + test(`verModeNone target; ${testName}`, async () => + await verModeNoneTargetProxyTest(opts)); + } + } + } + } + } + }); +}); + +async function basicProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + ssl: { verificationMode: 'none' }, + customHostSettings: [{ url: target.url, ssl: { certificateAuthoritiesData: CA } }], + }); + + const res = await request({ ...axiosDefaults, configurationUtilities: acu }); + expect(res.status).toBe(200); + }); +} + +async function wrongTargetPasswordProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + ssl: { verificationMode: 'none' }, + customHostSettings: [{ url: target.url, ssl: { certificateAuthoritiesData: CA } }], + }); + + const wrongUrl = manglePassword(target.url); + const res = await request({ ...axiosDefaults, url: wrongUrl, configurationUtilities: acu }); + expect(res.status).toBe(403); + }); +} + +async function missingTargetPasswordProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + ssl: { verificationMode: 'none' }, + customHostSettings: [{ url: target.url, ssl: { certificateAuthoritiesData: CA } }], + }); + + const anonUrl = removePassword(target.url); + const res = await request({ ...axiosDefaults, url: anonUrl, configurationUtilities: acu }); + expect(res.status).toBe(401); + }); +} + +async function wrongProxyPasswordProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const wrongUrl = manglePassword(proxy.url); + const acu = getACUfromConfig({ + proxyUrl: wrongUrl, + ssl: { verificationMode: 'none' }, + }); + + try { + await request({ ...axiosDefaults, configurationUtilities: acu }); + expect('request should have thrown error').toBeUndefined(); + } catch (err) { + expect(err.message).toMatch('407'); + } + }); +} + +async function missingProxyPasswordProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const anonUrl = removePassword(proxy.url); + const acu = getACUfromConfig({ + proxyUrl: anonUrl, + ssl: { verificationMode: 'none' }, + }); + + try { + await request({ ...axiosDefaults, configurationUtilities: acu }); + expect('request should have thrown error').toBeUndefined(); + } catch (err) { + expect(err.message).toMatch('407'); + } + }); +} + +async function missingCaProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + }); + + try { + await request({ ...axiosDefaults, configurationUtilities: acu }); + expect('request should have thrown error').toBeUndefined(); + } catch (err) { + expect(err.code).toEqual('UNABLE_TO_VERIFY_LEAF_SIGNATURE'); + } + }); +} + +async function rejectUnauthorizedTargetProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + rejectUnauthorized: false, + customHostSettings: [{ url: target.url, ssl: { verificationMode: 'none' } }], + }); + + const res = await request({ ...axiosDefaults, configurationUtilities: acu }); + expect(res.status).toBe(200); + }); +} + +async function customCAProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + customHostSettings: [{ url: target.url, ssl: { certificateAuthoritiesData: CA } }], + }); + + const res = await request({ ...axiosDefaults, configurationUtilities: acu }); + expect(res.status).toBe(200); + }); +} + +async function verModeNoneTargetProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + customHostSettings: [{ url: target.url, ssl: { verificationMode: 'none' } }], + }); + + const res = await request({ ...axiosDefaults, configurationUtilities: acu }); + expect(res.status).toBe(200); + }); +} + +interface RunTestOptions { + targetHttps: boolean; + targetAuth: boolean; + proxyHttps: boolean; + proxyAuth: boolean; +} + +type AxiosParams = Parameters[0]; + +type Test = ( + target: CreateServerResult, + proxy: CreateProxyResult, + axiosDefaults: AxiosParams +) => Promise; + +async function runWithSetup(opts: RunTestOptions, fn: Test) { + const target = await createServer({ + useHttps: opts.targetHttps, + requireAuth: opts.targetAuth, + }); + + const proxy = await createProxy({ + useHttps: opts.proxyHttps, + requireAuth: opts.proxyAuth, + }); + + const axiosDefaults = { + axios, + logger, + validateStatus, + url: target.url, + configurationUtilities: getACUfromConfig({ + proxyUrl: proxy.url, + }), + }; + + try { + await fn(target, proxy, axiosDefaults); + } catch (err) { + expect(err).toBeUndefined(); + } + + target.server.close(); + proxy.server.close(); +} + +function testLabel(type: string, tls: boolean, auth: boolean) { + return `${type} https ${tls ? 'X' : '-'} auth ${auth ? 'X' : '-'}`; +} + +function validateStatus(status: number) { + return true; +} + +function manglePassword(url: string) { + const parsed = new URL(url); + parsed.password = `nope-${parsed.password}-nope`; + return parsed.toString(); +} + +function removePassword(url: string) { + const parsed = new URL(url); + parsed.username = ''; + parsed.password = ''; + return parsed.toString(); +} + +const TlsOptions = { + cert: KIBANA_CRT, + key: KIBANA_KEY, +}; + +interface CreateServerOptions { + useHttps: boolean; + requireAuth?: boolean; +} + +interface CreateServerResult { + url: string; + server: http.Server | https.Server; +} + +async function createServer(options: CreateServerOptions): Promise { + const { useHttps, requireAuth = false } = options; + const port = await getPort(); + const url = `http${useHttps ? 's' : ''}://${requireAuth ? `${Auth}@` : ''}localhost:${port}`; + + function requestHandler(req: http.IncomingMessage, res: http.ServerResponse) { + if (requireAuth) { + const auth = req.headers.authorization; + if (auth == null) { + res.setHeader('WWW-Authenticate', 'Basic'); + res.writeHead(401); + res.end('authorization required'); + return; + } + if (auth !== `Basic ${AuthB64}`) { + res.writeHead(403); + res.end('not authorized'); + return; + } + } + + res.writeHead(200); + res.end('http: just testing that a connection could be made'); + } + + let server: http.Server | https.Server; + if (!useHttps) { + server = http.createServer(requestHandler); + } else { + server = https.createServer(TlsOptions, requestHandler); + } + server.unref(); + + const readySignal = createReadySignal(); + server.listen(port, 'localhost', () => { + readySignal.signal({ url, server }); + }); + + return readySignal.wait(); +} + +interface CreateProxyOptions { + useHttps: boolean; + requireAuth?: boolean; +} + +interface CreateProxyResult { + url: string; + server: http.Server | https.Server; +} + +type AuthenticateCallback = (err: null | Error, authenticated: boolean) => void; + +interface IAuthenticate { + authenticate(req: http.IncomingMessage, callback: AuthenticateCallback): void; +} + +async function createProxy(options: CreateProxyOptions): Promise { + const { useHttps, requireAuth = false } = options; + const port = await getPort(); + const url = getUrl(useHttps, requireAuth, port); + let proxyServer: http.Server | https.Server; + + if (!useHttps) { + proxyServer = http.createServer(); + } else { + proxyServer = https.createServer(TlsOptions); + } + proxyServer.unref(); + + proxySetup(proxyServer); + if (requireAuth) { + (proxyServer as unknown as IAuthenticate).authenticate = (req, callback) => { + const auth = req.headers['proxy-authorization']; + callback(null, auth === `Basic ${AuthB64}`); + }; + } + + const readySignal = createReadySignal(); + + proxyServer.listen(port, 'localhost', () => { + readySignal.signal({ server: proxyServer, url }); + }); + + return readySignal.wait(); +} + +function getUrl(useHttps: boolean, requiresAuth: boolean, port: number) { + return `http${useHttps ? 's' : ''}://${requiresAuth ? `${Auth}@` : ''}localhost:${port}`; +} + +const BaseActionsConfig: ActionsConfig = { + allowedHosts: ['*'], + enabledActionTypes: ['*'], + preconfiguredAlertHistoryEsIndex: false, + preconfigured: {}, + proxyUrl: undefined, + proxyHeaders: undefined, + proxyRejectUnauthorizedCertificates: true, + ssl: { + proxyVerificationMode: 'full', + verificationMode: 'full', + }, + proxyBypassHosts: undefined, + proxyOnlyHosts: undefined, + rejectUnauthorized: true, + maxResponseContentLength: ByteSizeValue.parse('1mb'), + responseTimeout: momentDuration(1000 * 30), + customHostSettings: undefined, + cleanupFailedExecutionsTask: { + enabled: true, + cleanupInterval: schema.duration().validate('5m'), + idleInterval: schema.duration().validate('1h'), + pageSize: 100, + }, +}; + +function getACUfromConfig(config: Partial = {}): ActionsConfigurationUtilities { + const resolvedConfig = resolveCustomHosts(logger, { ...BaseActionsConfig, ...config }); + return getActionsConfigurationUtilities(resolvedConfig); +} diff --git a/x-pack/plugins/actions/server/integration_tests/axios_utils_proxy.test.ts b/x-pack/plugins/actions/server/integration_tests/axios_utils_proxy.test.ts new file mode 100644 index 0000000000000..48aca5cd7381f --- /dev/null +++ b/x-pack/plugins/actions/server/integration_tests/axios_utils_proxy.test.ts @@ -0,0 +1,607 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor 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 @typescript-eslint/no-var-requires +const proxySetup = require('proxy'); + +import { readFileSync as fsReadFileSync } from 'fs'; +import { resolve as pathResolve, join as pathJoin } from 'path'; +import http from 'http'; +import https from 'https'; +import axios from 'axios'; +import { duration as momentDuration } from 'moment'; +import { schema } from '@kbn/config-schema'; +import getPort from 'get-port'; + +import { request } from '../builtin_action_types/lib/axios_utils'; +import { ByteSizeValue } from '@kbn/config-schema'; +import { Logger } from '@kbn/core/server'; +import { loggingSystemMock } from '@kbn/core/server/mocks'; +import { createReadySignal } from '@kbn/event-log-plugin/server/lib/ready_signal'; +import { ActionsConfig } from '../config'; +import { ActionsConfigurationUtilities, getActionsConfigurationUtilities } from '../actions_config'; +import { resolveCustomHosts } from '../lib/custom_host_settings'; + +const logger = loggingSystemMock.create().get() as jest.Mocked; + +const CERT_DIR = '../../../../../../packages/kbn-dev-utils/certs'; + +const KIBANA_CRT_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'kibana.crt')); +const KIBANA_KEY_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'kibana.key')); +const CA_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'ca.crt')); + +const KIBANA_KEY = fsReadFileSync(KIBANA_KEY_FILE, 'utf8'); +const KIBANA_CRT = fsReadFileSync(KIBANA_CRT_FILE, 'utf8'); +const CA = fsReadFileSync(CA_FILE, 'utf8'); + +const Auth = 'elastic:changeme'; +const AuthB64 = Buffer.from(Auth).toString('base64'); + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const AxiosDefaultsAadapter = require('axios/lib/adapters/http'); + +const ServerResponse = 'A unique response returned by the server!'; + +describe('axios connections', () => { + let testServer: http.Server | https.Server | null; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let savedAxiosDefaultsAdapter: any; + + beforeEach(() => { + // needed to prevent the dreaded Error: Cross origin http://localhost forbidden + // see: https://github.com/axios/axios/issues/1754#issuecomment-572778305 + savedAxiosDefaultsAdapter = axios.defaults.adapter; + axios.defaults.adapter = AxiosDefaultsAadapter; + }); + + afterEach(() => { + axios.defaults.adapter = savedAxiosDefaultsAdapter; + }); + + beforeEach(() => { + jest.resetAllMocks(); + }); + + afterEach(() => { + testServer?.close(); + testServer = null; + }); + + describe('http', () => { + test('it works', async () => { + const { url, server } = await createServer({ useHttps: false }); + testServer = server; + + const configurationUtilities = getACUfromConfig(); + const res = await request({ axios, url, logger, configurationUtilities }); + expect(res.status).toBe(200); + expect(res.data).toBe(ServerResponse); + }); + }); + + describe('https', () => { + test('it fails with self-signed cert and no overrides', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig(); + const fn = async () => await request({ axios, url, logger, configurationUtilities }); + await expect(fn()).rejects.toThrow('certificate'); + }); + + test('it works with verificationMode "none" config', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + ssl: { + verificationMode: 'none', + }, + }); + const res = await request({ axios, url, logger, configurationUtilities }); + expect(res.status).toBe(200); + expect(res.data).toBe(ServerResponse); + }); + + test('it works with verificationMode "none" for custom host config', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + customHostSettings: [{ url, ssl: { verificationMode: 'none' } }], + }); + const res = await request({ axios, url, logger, configurationUtilities }); + expect(res.status).toBe(200); + expect(res.data).toBe(ServerResponse); + }); + + test('it works with ca in custom host config', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + customHostSettings: [{ url, ssl: { certificateAuthoritiesData: CA } }], + }); + const res = await request({ axios, url, logger, configurationUtilities }); + expect(res.status).toBe(200); + expect(res.data).toBe(ServerResponse); + }); + + test('it fails with incorrect ca in custom host config', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + customHostSettings: [{ url, ssl: { certificateAuthoritiesData: KIBANA_CRT } }], + }); + const fn = async () => await request({ axios, url, logger, configurationUtilities }); + await expect(fn()).rejects.toThrow('certificate'); + }); + + test('it works with incorrect ca in custom host config but verificationMode "none"', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + customHostSettings: [ + { + url, + ssl: { + certificateAuthoritiesData: CA, + verificationMode: 'none', + }, + }, + ], + }); + const res = await request({ axios, url, logger, configurationUtilities }); + expect(res.status).toBe(200); + expect(res.data).toBe(ServerResponse); + }); + + test('it works with incorrect ca in custom host config but verificationMode config "full"', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + ssl: { + verificationMode: 'none', + }, + customHostSettings: [ + { + url, + ssl: { + certificateAuthoritiesData: CA, + }, + }, + ], + }); + const res = await request({ axios, url, logger, configurationUtilities }); + expect(res.status).toBe(200); + expect(res.data).toBe(ServerResponse); + }); + + test('it fails with no matching custom host settings', async () => { + const { url, server } = await createServer({ useHttps: true }); + const otherUrl = 'https://example.com'; + testServer = server; + + const configurationUtilities = getACUfromConfig({ + customHostSettings: [{ url: otherUrl, ssl: { verificationMode: 'none' } }], + }); + const fn = async () => await request({ axios, url, logger, configurationUtilities }); + await expect(fn()).rejects.toThrow('certificate'); + }); + + test('it fails cleanly with a garbage CA 1', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const configurationUtilities = getACUfromConfig({ + customHostSettings: [{ url, ssl: { certificateAuthoritiesData: 'garbage' } }], + }); + const fn = async () => await request({ axios, url, logger, configurationUtilities }); + await expect(fn()).rejects.toThrow('certificate'); + }); + + test('it fails cleanly with a garbage CA 2', async () => { + const { url, server } = await createServer({ useHttps: true }); + testServer = server; + + const ca = '-----BEGIN CERTIFICATE-----\ngarbage\n-----END CERTIFICATE-----\n'; + const configurationUtilities = getACUfromConfig({ + customHostSettings: [{ url, ssl: { certificateAuthoritiesData: ca } }], + }); + const fn = async () => await request({ axios, url, logger, configurationUtilities }); + await expect(fn()).rejects.toThrow('certificate'); + }); + }); + + // targetHttps, proxyHttps, and proxyAuth should all range over [false, true], but + // currently the true versions are not passing + describe(`proxy`, () => { + for (const targetHttps of [false]) { + for (const targetAuth of [false, true]) { + for (const proxyHttps of [false]) { + for (const proxyAuth of [false]) { + const targetLabel = testLabel('target', targetHttps, targetAuth); + const proxyLabel = testLabel('proxy', proxyHttps, proxyAuth); + const testName = `${targetLabel} :: ${proxyLabel}`; + + const opts = { targetHttps, targetAuth, proxyHttps, proxyAuth }; + + test(`basic; ${testName}`, async () => await basicProxyTest(opts)); + + if (targetAuth) { + test(`wrong target password; ${testName}`, async () => + await wrongTargetPasswordProxyTest(opts)); + + test(`missing target password; ${testName}`, async () => + await missingTargetPasswordProxyTest(opts)); + } + + if (proxyAuth) { + test(`wrong proxy password; ${testName}`, async () => + await wrongProxyPasswordProxyTest(opts)); + + test(`missing proxy password; ${testName}`, async () => + await missingProxyPasswordProxyTest(opts)); + } + + if (targetHttps) { + test(`missing CA; ${testName}`, async () => + await missingCaProxyTest(opts)); + + test(`rejectUnauthorized target; ${testName}`, async () => + await rejectUnauthorizedTargetProxyTest(opts)); + + test(`custom CA target; ${testName}`, async () => + await customCAProxyTest(opts)); + + test(`verModeNone target; ${testName}`, async () => + await verModeNoneTargetProxyTest(opts)); + } + } + } + } + } + }); +}); + +async function basicProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + ssl: { verificationMode: 'none' }, + customHostSettings: [{ url: target.url, ssl: { certificateAuthoritiesData: CA } }], + }); + + const res = await request({ ...axiosDefaults, configurationUtilities: acu }); + expect(res.status).toBe(200); + expect(res.data).toBe(ServerResponse); + }); +} + +async function wrongTargetPasswordProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + ssl: { verificationMode: 'none' }, + customHostSettings: [{ url: target.url, ssl: { certificateAuthoritiesData: CA } }], + }); + + const wrongUrl = manglePassword(target.url); + const res = await request({ ...axiosDefaults, url: wrongUrl, configurationUtilities: acu }); + expect(res.status).toBe(403); + }); +} + +async function missingTargetPasswordProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + ssl: { verificationMode: 'none' }, + customHostSettings: [{ url: target.url, ssl: { certificateAuthoritiesData: CA } }], + }); + + const anonUrl = removePassword(target.url); + const res = await request({ ...axiosDefaults, url: anonUrl, configurationUtilities: acu }); + expect(res.status).toBe(401); + }); +} + +async function wrongProxyPasswordProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const wrongUrl = manglePassword(proxy.url); + const acu = getACUfromConfig({ + proxyUrl: wrongUrl, + ssl: { verificationMode: 'none' }, + }); + + try { + await request({ ...axiosDefaults, configurationUtilities: acu }); + expect('request should have thrown error').toBeUndefined(); + } catch (err) { + expect(err.message).toMatch('407'); + } + }); +} + +async function missingProxyPasswordProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const anonUrl = removePassword(proxy.url); + const acu = getACUfromConfig({ + proxyUrl: anonUrl, + ssl: { verificationMode: 'none' }, + }); + + try { + await request({ ...axiosDefaults, configurationUtilities: acu }); + expect('request should have thrown error').toBeUndefined(); + } catch (err) { + expect(err.message).toMatch('407'); + } + }); +} + +async function missingCaProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + }); + + try { + await request({ ...axiosDefaults, configurationUtilities: acu }); + expect('request should have thrown error').toBeUndefined(); + } catch (err) { + expect(err.code).toEqual('UNABLE_TO_VERIFY_LEAF_SIGNATURE'); + } + }); +} + +async function rejectUnauthorizedTargetProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + rejectUnauthorized: false, + customHostSettings: [{ url: target.url, ssl: { verificationMode: 'none' } }], + }); + + const res = await request({ ...axiosDefaults, configurationUtilities: acu }); + expect(res.status).toBe(200); + expect(res.data).toBe(ServerResponse); + }); +} + +async function customCAProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + customHostSettings: [{ url: target.url, ssl: { certificateAuthoritiesData: CA } }], + }); + + const res = await request({ ...axiosDefaults, configurationUtilities: acu }); + expect(res.status).toBe(200); + expect(res.data).toBe(ServerResponse); + }); +} + +async function verModeNoneTargetProxyTest(opts: RunTestOptions) { + await runWithSetup(opts, async (target, proxy, axiosDefaults) => { + const acu = getACUfromConfig({ + proxyUrl: proxy.url, + customHostSettings: [{ url: target.url, ssl: { verificationMode: 'none' } }], + }); + + const res = await request({ ...axiosDefaults, configurationUtilities: acu }); + expect(res.status).toBe(200); + expect(res.data).toBe(ServerResponse); + }); +} + +interface RunTestOptions { + targetHttps: boolean; + targetAuth: boolean; + proxyHttps: boolean; + proxyAuth: boolean; +} + +type AxiosParams = Parameters[0]; + +type Test = ( + target: CreateServerResult, + proxy: CreateProxyResult, + axiosDefaults: AxiosParams +) => Promise; + +async function runWithSetup(opts: RunTestOptions, fn: Test) { + const target = await createServer({ + useHttps: opts.targetHttps, + requireAuth: opts.targetAuth, + }); + + const proxy = await createProxy({ + useHttps: opts.proxyHttps, + requireAuth: opts.proxyAuth, + }); + + const axiosDefaults = { + axios, + logger, + validateStatus, + url: target.url, + configurationUtilities: getACUfromConfig({ + proxyUrl: proxy.url, + }), + }; + + try { + await fn(target, proxy, axiosDefaults); + } catch (err) { + expect(err).toBeUndefined(); + } + + target.server.close(); + proxy.server.close(); +} + +function testLabel(type: string, tls: boolean, auth: boolean) { + return `${type} https ${tls ? 'X' : '-'} auth ${auth ? 'X' : '-'}`; +} + +function validateStatus(status: number) { + return true; +} + +function manglePassword(url: string) { + const parsed = new URL(url); + parsed.password = `nope-${parsed.password}-nope`; + return parsed.toString(); +} + +function removePassword(url: string) { + const parsed = new URL(url); + parsed.username = ''; + parsed.password = ''; + return parsed.toString(); +} + +const TlsOptions = { + cert: KIBANA_CRT, + key: KIBANA_KEY, +}; + +interface CreateServerOptions { + useHttps: boolean; + requireAuth?: boolean; +} + +interface CreateServerResult { + url: string; + server: http.Server | https.Server; +} + +async function createServer(options: CreateServerOptions): Promise { + const { useHttps, requireAuth = false } = options; + const port = await getPort(); + const url = `http${useHttps ? 's' : ''}://${requireAuth ? `${Auth}@` : ''}localhost:${port}`; + + function requestHandler(req: http.IncomingMessage, res: http.ServerResponse) { + if (requireAuth) { + const auth = req.headers.authorization; + if (auth == null) { + res.setHeader('WWW-Authenticate', 'Basic'); + res.writeHead(401); + res.end('authorization required'); + return; + } + if (auth !== `Basic ${AuthB64}`) { + res.writeHead(403); + res.end('not authorized'); + return; + } + } + + res.writeHead(200); + res.end(ServerResponse); + } + + let server: http.Server | https.Server; + if (!useHttps) { + server = http.createServer(requestHandler); + } else { + server = https.createServer(TlsOptions, requestHandler); + } + server.unref(); + + const readySignal = createReadySignal(); + server.listen(port, 'localhost', () => { + readySignal.signal({ url, server }); + }); + + return readySignal.wait(); +} + +interface CreateProxyOptions { + useHttps: boolean; + requireAuth?: boolean; +} + +interface CreateProxyResult { + url: string; + server: http.Server | https.Server; +} + +type AuthenticateCallback = (err: null | Error, authenticated: boolean) => void; + +interface IAuthenticate { + authenticate(req: http.IncomingMessage, callback: AuthenticateCallback): void; +} + +async function createProxy(options: CreateProxyOptions): Promise { + const { useHttps, requireAuth = false } = options; + const port = await getPort(); + const url = getUrl(useHttps, requireAuth, port); + let proxyServer: http.Server | https.Server; + + if (!useHttps) { + proxyServer = http.createServer(); + } else { + proxyServer = https.createServer(TlsOptions); + } + proxyServer.unref(); + + proxySetup(proxyServer); + if (requireAuth) { + (proxyServer as unknown as IAuthenticate).authenticate = (req, callback) => { + const auth = req.headers['proxy-authorization']; + callback(null, auth === `Basic ${AuthB64}`); + }; + } + + const readySignal = createReadySignal(); + + proxyServer.listen(port, 'localhost', () => { + readySignal.signal({ server: proxyServer, url }); + }); + + return readySignal.wait(); +} + +function getUrl(useHttps: boolean, requiresAuth: boolean, port: number) { + return `http${useHttps ? 's' : ''}://${requiresAuth ? `${Auth}@` : ''}localhost:${port}`; +} + +const BaseActionsConfig: ActionsConfig = { + allowedHosts: ['*'], + enabledActionTypes: ['*'], + preconfiguredAlertHistoryEsIndex: false, + preconfigured: {}, + proxyUrl: undefined, + proxyHeaders: undefined, + proxyRejectUnauthorizedCertificates: true, + ssl: { + proxyVerificationMode: 'full', + verificationMode: 'full', + }, + proxyBypassHosts: undefined, + proxyOnlyHosts: undefined, + rejectUnauthorized: true, + maxResponseContentLength: ByteSizeValue.parse('1mb'), + responseTimeout: momentDuration(1000 * 30), + customHostSettings: undefined, + cleanupFailedExecutionsTask: { + enabled: true, + cleanupInterval: schema.duration().validate('5m'), + idleInterval: schema.duration().validate('1h'), + pageSize: 100, + }, +}; + +function getACUfromConfig(config: Partial = {}): ActionsConfigurationUtilities { + const resolvedConfig = resolveCustomHosts(logger, { ...BaseActionsConfig, ...config }); + return getActionsConfigurationUtilities(resolvedConfig); +} diff --git a/x-pack/plugins/actions/server/manual_tests/forward_proxy.js b/x-pack/plugins/actions/server/manual_tests/forward_proxy.js index e562d3edabdb6..17475866b3111 100644 --- a/x-pack/plugins/actions/server/manual_tests/forward_proxy.js +++ b/x-pack/plugins/actions/server/manual_tests/forward_proxy.js @@ -6,108 +6,151 @@ */ /* -This module implements two forward http proxies, http on 8080 and https on 8443, -which can be used with the config xpack.actions.proxyUrl to emulate customers -using forward proxies with Kibana actions. You can use either the http or https -versions, both can forward proxy http and https traffic: - - xpack.actions.proxyUrl: http://localhost:8080 - OR - xpack.actions.proxyUrl: https://localhost:8443 +Starts http and https proxies to use to test actions within Kibana or with curl. -When using the https-based version, you may need to set the following option -as well: +Assumes you have elasticsearch running on https://elastic:changeme@localhost:9200, +otherwise expect 500 responses from those requests. All other requests should +work as expected. - xpack.actions.rejectUnauthorized: false +# start 4 proxies: -If the server you are connecting to via the proxy is https and has self-signed -certificates, you'll also need to set +node x-pack/plugins/actions/server/manual_tests/forward_proxy.js http-8080-open http-8081-auth https-8443-open https-8444-auth - xpack.actions.proxyRejectUnauthorizedCertificates: false -*/ +# issue some requests through the proxies -const HTTP_PORT = 8080; -const HTTPS_PORT = 8443; +curl -k --no-alpn -o /dev/null --proxy-insecure -x http://127.0.0.1:8080 http://www.example.com; \ +curl -k --no-alpn -o /dev/null --proxy-insecure -x http://127.0.0.1:8080 https://www.example.com; \ +curl -k --no-alpn -o /dev/null --proxy-insecure -x https://127.0.0.1:8443 http://www.example.com; \ +curl -k --no-alpn -o /dev/null --proxy-insecure -x https://127.0.0.1:8443 https://www.example.com; \ +curl -k --no-alpn -o /dev/null --proxy-insecure -x http://127.0.0.1:8080 https://elastic:changeme@localhost:9200; \ +curl -k --no-alpn -o /dev/null --proxy-insecure -x https://127.0.0.1:8443 https://elastic:changeme@localhost:9200; \ +curl -k --no-alpn -o /dev/null --proxy-insecure -x http://127.0.0.1:8081 --proxy-user elastic:changeme http://www.example.com; \ +curl -k --no-alpn -o /dev/null --proxy-insecure -x http://127.0.0.1:8081 --proxy-user elastic:changeme https://www.example.com; \ +curl -k --no-alpn -o /dev/null --proxy-insecure -x https://127.0.0.1:8444 --proxy-user elastic:changeme http://www.example.com; \ +curl -k --no-alpn -o /dev/null --proxy-insecure -x https://127.0.0.1:8444 --proxy-user elastic:changeme https://www.example.com; \ +curl -k --no-alpn -o /dev/null --proxy-insecure -x http://127.0.0.1:8081 --proxy-user elastic:changeme https://elastic:changeme@localhost:9200; \ +curl -k --no-alpn -o /dev/null --proxy-insecure -x https://127.0.0.1:8444 --proxy-user elastic:changeme https://elastic:changeme@localhost:9200; \ +echo done - you should run all the lines above as one command -// starts http and https proxies to use to test actions within Kibana +*/ const fs = require('fs'); -const net = require('net'); -const url = require('url'); +const path = require('path'); const http = require('http'); const https = require('https'); -const httpProxy = require('http-proxy'); +const proxySetup = require('proxy'); + +const PROGRAM = path.basename(__filename).replace(/.js$/, ''); +const CertDir = path.resolve(__dirname, '../../../../../packages/kbn-dev-utils/certs'); -const httpsOptions = { - key: fs.readFileSync('packages/kbn-dev-utils/certs/kibana.key', 'utf8'), - cert: fs.readFileSync('packages/kbn-dev-utils/certs/kibana.crt', 'utf8'), +const Auth = 'elastic:changeme'; +const AuthB64 = Buffer.from(Auth).toString('base64'); + +const HttpsOptions = { + key: fs.readFileSync(path.join(CertDir, 'kibana.key'), 'utf8'), + cert: fs.readFileSync(path.join(CertDir, 'kibana.crt'), 'utf8'), }; -const proxy = httpProxy.createServer(); +async function main() { + const args = process.argv.slice(2); + if (args.length === 0) { + help(); + process.exit(1); + } -createServer('http', HTTP_PORT); -createServer('https', HTTPS_PORT); + const specs = args.map(argToSpec); + for (const spec of specs) { + const { protocol, port, auth } = spec; + createServer(protocol, port, auth); + } +} -function createServer(protocol, port) { - let httpServer; +/** @type { (protocol: string, port: number, auth: boolean) => Promise } */ +async function createServer(protocol, port, auth) { + let proxyServer; if (protocol === 'http') { - httpServer = http.createServer(); + proxyServer = http.createServer(); } else { - httpServer = https.createServer(httpsOptions); + proxyServer = https.createServer(HttpsOptions); } - httpServer.on('request', httpRequest); - httpServer.on('connect', httpsRequest); - httpServer.listen(port); - log(`proxy server started: ${protocol}:/localhost:${port}`); - - // handle http requests - function httpRequest(req, res) { - log(`${protocol} server: request for: ${req.url}`); - const parsedUrl = url.parse(req.url); - if (parsedUrl.hostname == null) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('this is a proxy server'); - return; - } - const target = parsedUrl.protocol + '//' + parsedUrl.hostname; - proxy.web(req, res, { target: target, secure: false }); + proxySetup(proxyServer); + + let authLabel = ''; + if (auth) { + authLabel = `${Auth}@`; + proxyServer.authenticate = (req, callback) => { + const auth = req.headers['proxy-authorization']; + callback(null, auth === `Basic ${AuthB64}`); + }; } - // handle https requests - // see: https://nodejs.org/dist/latest-v14.x/docs/api/http.html#http_event_connect - function httpsRequest(req, socket, head) { - log(`${protocol} proxy server: request for target: https://${req.url}`); - const serverUrl = url.parse('https://' + req.url); - const serverSocket = net.connect(serverUrl.port, serverUrl.hostname, () => { - socket.write('HTTP/1.1 200 Connection Established\r\nProxy-agent: Node-Proxy\r\n\r\n'); - serverSocket.write(head); - serverSocket.pipe(socket); - socket.pipe(serverSocket); - }); - socket.on('error', (err) => { - log(`error on socket to proxy: ${err}`); - socket.destroy(); - serverSocket.destroy(); - }); - serverSocket.on('error', (err) => { - log(`error on socket to target: ${err}`); - socket.destroy(); - serverSocket.destroy(); - }); + const serverLabel = `${protocol}://${authLabel}localhost:${port}`; + proxyServer.listen(port, 'localhost', () => { + console.log(`proxy server started on ${serverLabel}`); + }); +} + +/* convert 'proto-port-auth' into object with shape shown below */ +/** @type { (arg: string) => void | { protocol: string, port: number, auth: boolean } } */ +function argToSpec(arg) { + const parts = arg.split('-'); + if (parts.length < 2) { + return logError(`invalid spec: ${arg}`); } + + const [protocol, portString, authString] = parts; + + if (!protocol) return logError(`empty protocol in '${arg}'`); + if (protocol !== 'http' && protocol !== 'https') + return logError(`invalid protocol in '${arg}': '${protocol}'`); + + if (!portString) return logError(`empty port in '${arg}'`); + const port = Number.parseInt(portString, 10); + if (isNaN(port)) return logError(`invalid port in '${arg}': ${portString}`); + + let auth; + if (!authString) { + auth = false; + } else { + if (authString !== 'auth' && authString !== 'open') + return logError(`invalid auth in '${arg}': '${authString}'`); + auth = authString === 'auth'; + } + + return { protocol, port, auth }; } +/** @type { (message: string) => void } */ function log(message) { console.log(`${new Date().toISOString()} - ${message}`); } -/* -Test with: +/** @type { (message: string) => void } */ +function logError(message) { + log(message); + process.exit(1); +} -curl -v -k --proxy-insecure -x http://127.0.0.1:8080 http://www.google.com -curl -v -k --proxy-insecure -x http://127.0.0.1:8080 https://www.google.com -curl -v -k --proxy-insecure -x https://127.0.0.1:8443 http://www.google.com -curl -v -k --proxy-insecure -x https://127.0.0.1:8443 https://www.google.com -*/ +main(); + +function help() { + console.log(`${PROGRAM} - create http proxies to test connectors with`); + console.log(`usage:`); + console.log(` ${PROGRAM} spec spec spec ...`); + console.log(``); + console.log(`options:`); + console.log(` - none yet`); + console.log(``); + console.log(`parameters:`); + console.log(` spec: spec is a 3-part token, separated by '-' chars`); + console.log(` [proto]-[port]-[auth]`); + console.log(` proto - 'http' or 'https'`); + console.log(` port - port to open the proxy on`); + console.log(` auth - 'auth' or 'open' (auth expects user/pass elastic:change)`); + console.log(``); + console.log(`example:`); + console.log(` ${PROGRAM} {options} http-8080-open https-8443-open`); + console.log(` `); +} diff --git a/x-pack/plugins/aiops/public/components/document_count_content/document_count_chart/document_count_chart.tsx b/x-pack/plugins/aiops/public/components/document_count_content/document_count_chart/document_count_chart.tsx index 79f5494b419ca..4a7d4dd583de5 100644 --- a/x-pack/plugins/aiops/public/components/document_count_content/document_count_chart/document_count_chart.tsx +++ b/x-pack/plugins/aiops/public/components/document_count_content/document_count_chart/document_count_chart.tsx @@ -33,6 +33,15 @@ import { useAiOpsKibana } from '../../../kibana_context'; import { BrushBadge } from './brush_badge'; +declare global { + interface Window { + /** + * Flag used to enable debugState on elastic charts + */ + _echDebugStateFlag?: boolean; + } +} + export interface DocumentCountChartPoint { time: number | string; value: number; @@ -271,7 +280,7 @@ export const DocumentCountChart: FC = ({ return ( <> {isBrushVisible && ( -
+
= ({ }} theme={chartTheme} baseTheme={chartBaseTheme} + debugState={window._echDebugStateFlag ?? false} /> = ({ {clearSelectionLabel} diff --git a/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_analysis.tsx b/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_analysis.tsx index c9b74a634001e..4c99c3bb9279d 100644 --- a/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_analysis.tsx +++ b/x-pack/plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_analysis.tsx @@ -112,7 +112,7 @@ export const ExplainLogRateSpikesAnalysis: FC const showSpikeAnalysisTable = data?.changePoints.length > 0; return ( - <> +
{!isRunning && !showSpikeAnalysisTable && ( selectedChangePoint={selectedChangePoint} /> )} - +
); }; diff --git a/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx b/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx index 4b7d2bb1d0597..6ae778e48e3e0 100644 --- a/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx +++ b/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx @@ -56,6 +56,7 @@ export const SpikeAnalysisTable: FC = ({ const columns: Array> = [ { + 'data-test-subj': 'aiopsSpikeAnalysisTableColumnFieldName', field: 'fieldName', name: i18n.translate( 'xpack.aiops.correlations.failedTransactions.correlationsTable.fieldNameLabel', @@ -64,6 +65,7 @@ export const SpikeAnalysisTable: FC = ({ sortable: true, }, { + 'data-test-subj': 'aiopsSpikeAnalysisTableColumnFieldValue', field: 'fieldValue', name: i18n.translate( 'xpack.aiops.correlations.failedTransactions.correlationsTable.fieldValueLabel', @@ -73,6 +75,7 @@ export const SpikeAnalysisTable: FC = ({ sortable: true, }, { + 'data-test-subj': 'aiopsSpikeAnalysisTableColumnLogRate', width: NARROW_COLUMN_WIDTH, field: 'pValue', name: ( @@ -105,6 +108,7 @@ export const SpikeAnalysisTable: FC = ({ sortable: false, }, { + 'data-test-subj': 'aiopsSpikeAnalysisTableColumnPValue', width: NARROW_COLUMN_WIDTH, field: 'pValue', name: ( @@ -131,6 +135,7 @@ export const SpikeAnalysisTable: FC = ({ sortable: true, }, { + 'data-test-subj': 'aiopsSpikeAnalysisTableColumnImpact', width: NARROW_COLUMN_WIDTH, field: 'pValue', name: ( @@ -210,6 +215,7 @@ export const SpikeAnalysisTable: FC = ({ return ( = ({ sorting={sorting as EuiTableSortingType} rowProps={(changePoint) => { return { + 'data-test-subj': `aiopsSpikeAnalysisTableRow row-${changePoint.fieldName}-${changePoint.fieldValue}`, onClick: () => { if (onPinnedChangePoint) { onPinnedChangePoint(changePoint); diff --git a/x-pack/plugins/alerting/common/rule.ts b/x-pack/plugins/alerting/common/rule.ts index cfd93f475b883..1514de7b95209 100644 --- a/x-pack/plugins/alerting/common/rule.ts +++ b/x-pack/plugins/alerting/common/rule.ts @@ -45,6 +45,7 @@ export enum RuleExecutionStatusErrorReasons { export enum RuleExecutionStatusWarningReasons { MAX_EXECUTABLE_ACTIONS = 'maxExecutableActions', + MAX_ALERTS = 'maxAlerts', } export interface RuleExecutionStatus { diff --git a/x-pack/plugins/alerting/server/alert/create_alert_factory.test.ts b/x-pack/plugins/alerting/server/alert/create_alert_factory.test.ts index c9505d5f838e2..9b8b95e8af36f 100644 --- a/x-pack/plugins/alerting/server/alert/create_alert_factory.test.ts +++ b/x-pack/plugins/alerting/server/alert/create_alert_factory.test.ts @@ -29,6 +29,7 @@ describe('createAlertFactory()', () => { const alertFactory = createAlertFactory({ alerts: {}, logger, + maxAlerts: 1000, }); const result = alertFactory.create('1'); expect(result).toMatchInlineSnapshot(` @@ -51,6 +52,7 @@ describe('createAlertFactory()', () => { '1': alert, }, logger, + maxAlerts: 1000, }); const result = alertFactory.create('1'); expect(result).toMatchInlineSnapshot(` @@ -73,6 +75,7 @@ describe('createAlertFactory()', () => { const alertFactory = createAlertFactory({ alerts, logger, + maxAlerts: 1000, }); alertFactory.create('1'); expect(alerts).toMatchInlineSnapshot(` @@ -85,10 +88,30 @@ describe('createAlertFactory()', () => { `); }); + test('throws error and sets flag when more alerts are created than allowed', () => { + const alertFactory = createAlertFactory({ + alerts: {}, + logger, + maxAlerts: 3, + }); + + expect(alertFactory.hasReachedAlertLimit()).toBe(false); + alertFactory.create('1'); + alertFactory.create('2'); + alertFactory.create('3'); + + expect(() => { + alertFactory.create('4'); + }).toThrowErrorMatchingInlineSnapshot(`"Rule reported more than 3 alerts."`); + + expect(alertFactory.hasReachedAlertLimit()).toBe(true); + }); + test('throws error when creating alerts after done() is called', () => { const alertFactory = createAlertFactory({ alerts: {}, logger, + maxAlerts: 1000, }); const result = alertFactory.create('1'); expect(result).toEqual({ @@ -127,6 +150,7 @@ describe('createAlertFactory()', () => { alerts: {}, logger, canSetRecoveryContext: true, + maxAlerts: 1000, }); const result = alertFactory.create('1'); expect(result).toEqual({ @@ -149,6 +173,7 @@ describe('createAlertFactory()', () => { const alertFactory = createAlertFactory({ alerts: {}, logger, + maxAlerts: 1000, canSetRecoveryContext: true, }); const result = alertFactory.create('1'); @@ -171,6 +196,7 @@ describe('createAlertFactory()', () => { const alertFactory = createAlertFactory({ alerts: {}, logger, + maxAlerts: 1000, canSetRecoveryContext: true, }); const result = alertFactory.create('1'); @@ -192,6 +218,7 @@ describe('createAlertFactory()', () => { const alertFactory = createAlertFactory({ alerts: {}, logger, + maxAlerts: 1000, canSetRecoveryContext: false, }); const result = alertFactory.create('1'); diff --git a/x-pack/plugins/alerting/server/alert/create_alert_factory.ts b/x-pack/plugins/alerting/server/alert/create_alert_factory.ts index 5a9dad5cdada8..158926a19d782 100644 --- a/x-pack/plugins/alerting/server/alert/create_alert_factory.ts +++ b/x-pack/plugins/alerting/server/alert/create_alert_factory.ts @@ -25,6 +25,7 @@ export interface CreateAlertFactoryOpts< > { alerts: Record>; logger: Logger; + maxAlerts: number; canSetRecoveryContext?: boolean; } @@ -32,21 +33,40 @@ export function createAlertFactory< State extends AlertInstanceState, Context extends AlertInstanceContext, ActionGroupIds extends string ->({ alerts, logger, canSetRecoveryContext = false }: CreateAlertFactoryOpts) { +>({ + alerts, + logger, + maxAlerts, + canSetRecoveryContext = false, +}: CreateAlertFactoryOpts) { // Keep track of which alerts we started with so we can determine which have recovered const originalAlerts = cloneDeep(alerts); + + // Number of alerts reported + let numAlertsCreated = 0; + + // Whether the number of alerts reported has reached max allowed + let hasReachedAlertLimit = false; + let isDone = false; return { create: (id: string): PublicAlert => { if (isDone) { throw new Error(`Can't create new alerts after calling done() in AlertsFactory.`); } + + if (numAlertsCreated++ >= maxAlerts) { + hasReachedAlertLimit = true; + throw new Error(`Rule reported more than ${maxAlerts} alerts.`); + } + if (!alerts[id]) { alerts[id] = new Alert(id); } return alerts[id]; }, + hasReachedAlertLimit: (): boolean => hasReachedAlertLimit, done: (): AlertFactoryDoneUtils => { isDone = true; return { @@ -59,8 +79,12 @@ export function createAlertFactory< } const { recoveredAlerts } = processAlerts( - alerts, - originalAlerts + { + alerts, + existingAlerts: originalAlerts, + hasReachedAlertLimit, + alertLimit: maxAlerts, + } ); return Object.keys(recoveredAlerts ?? {}).map( (alertId: string) => recoveredAlerts[alertId] diff --git a/x-pack/plugins/alerting/server/config.test.ts b/x-pack/plugins/alerting/server/config.test.ts index 08ef06921a143..ec6f2f6565d67 100644 --- a/x-pack/plugins/alerting/server/config.test.ts +++ b/x-pack/plugins/alerting/server/config.test.ts @@ -30,6 +30,9 @@ describe('config validation', () => { "actions": Object { "max": 100000, }, + "alerts": Object { + "max": 1000, + }, }, }, } diff --git a/x-pack/plugins/alerting/server/config.ts b/x-pack/plugins/alerting/server/config.ts index 4f283917a460a..f6becbf192b05 100644 --- a/x-pack/plugins/alerting/server/config.ts +++ b/x-pack/plugins/alerting/server/config.ts @@ -43,6 +43,9 @@ const rulesSchema = schema.object({ max: schema.number({ defaultValue: 100000, max: 100000 }), connectorTypeOverrides: schema.maybe(schema.arrayOf(connectorTypeSchema)), }), + alerts: schema.object({ + max: schema.number({ defaultValue: 1000 }), + }), ruleTypeOverrides: schema.maybe(schema.arrayOf(ruleTypeSchema)), }), }); diff --git a/x-pack/plugins/alerting/server/constants/translations.ts b/x-pack/plugins/alerting/server/constants/translations.ts index ee1d711b56f8d..15442cf8efc57 100644 --- a/x-pack/plugins/alerting/server/constants/translations.ts +++ b/x-pack/plugins/alerting/server/constants/translations.ts @@ -17,6 +17,10 @@ export const translations = { 'The maximum number of actions for this rule type was reached; excess actions were not triggered.', } ), + maxAlerts: i18n.translate('xpack.alerting.taskRunner.warning.maxAlerts', { + defaultMessage: + 'Rule reported more than the maximum number of alerts in a single run. Alerts may be missed and recovery notifications may be delayed', + }), }, }, }; diff --git a/x-pack/plugins/alerting/server/lib/alerting_event_logger/alerting_event_logger.test.ts b/x-pack/plugins/alerting/server/lib/alerting_event_logger/alerting_event_logger.test.ts index 766e2c77531f3..74fe762f87b3a 100644 --- a/x-pack/plugins/alerting/server/lib/alerting_event_logger/alerting_event_logger.test.ts +++ b/x-pack/plugins/alerting/server/lib/alerting_event_logger/alerting_event_logger.test.ts @@ -653,6 +653,7 @@ describe('AlertingEventLogger', () => { numSearches: 6, esSearchDurationMs: 3300, totalSearchDurationMs: 10333, + hasReachedAlertLimit: false, triggeredActionsStatus: ActionsCompletion.COMPLETE, }, }); diff --git a/x-pack/plugins/alerting/server/lib/get_rule_task_timeout.test.ts b/x-pack/plugins/alerting/server/lib/get_rule_task_timeout.test.ts index 9336c380c1742..59d4260261ebb 100644 --- a/x-pack/plugins/alerting/server/lib/get_rule_task_timeout.test.ts +++ b/x-pack/plugins/alerting/server/lib/get_rule_task_timeout.test.ts @@ -37,6 +37,7 @@ const configWithoutTimeout = { ...config, run: { actions: { max: 1000 }, + alerts: { max: 1000 }, }, }; diff --git a/x-pack/plugins/alerting/server/lib/process_alerts.test.ts b/x-pack/plugins/alerting/server/lib/process_alerts.test.ts index a242ac471ad11..dcf13bdc4f7a1 100644 --- a/x-pack/plugins/alerting/server/lib/process_alerts.test.ts +++ b/x-pack/plugins/alerting/server/lib/process_alerts.test.ts @@ -30,13 +30,13 @@ describe('processAlerts', () => { const existingAlert1 = new Alert<{}, {}, DefaultActionGroupId>('2'); const existingAlert2 = new Alert<{}, {}, DefaultActionGroupId>('3'); - const originalAlerts = { + const existingAlerts = { '2': existingAlert1, '3': existingAlert2, }; const updatedAlerts = { - ...cloneDeep(originalAlerts), + ...cloneDeep(existingAlerts), '1': newAlert, }; @@ -44,8 +44,14 @@ describe('processAlerts', () => { updatedAlerts['2'].scheduleActions('default', { foo: '1' }); updatedAlerts['3'].scheduleActions('default', { foo: '2' }); - // @ts-expect-error - const { newAlerts } = processAlerts(updatedAlerts, originalAlerts); + const { newAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: false, + alertLimit: 10, + }); expect(newAlerts).toEqual({ '1': newAlert }); }); @@ -56,13 +62,13 @@ describe('processAlerts', () => { const existingAlert1 = new Alert<{}, {}, DefaultActionGroupId>('3'); const existingAlert2 = new Alert<{}, {}, DefaultActionGroupId>('4'); - const originalAlerts = { + const existingAlerts = { '3': existingAlert1, '4': existingAlert2, }; const updatedAlerts = { - ...cloneDeep(originalAlerts), + ...cloneDeep(existingAlerts), '1': newAlert1, '2': newAlert2, }; @@ -75,8 +81,14 @@ describe('processAlerts', () => { expect(newAlert1.getState()).toStrictEqual({}); expect(newAlert2.getState()).toStrictEqual({}); - // @ts-expect-error - const { newAlerts } = processAlerts(updatedAlerts, originalAlerts); + const { newAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: false, + alertLimit: 10, + }); expect(newAlerts).toEqual({ '1': newAlert1, '2': newAlert2 }); @@ -106,13 +118,13 @@ describe('processAlerts', () => { const existingAlert1 = new Alert<{}, {}, DefaultActionGroupId>('2'); const existingAlert2 = new Alert<{}, {}, DefaultActionGroupId>('3'); - const originalAlerts = { + const existingAlerts = { '2': existingAlert1, '3': existingAlert2, }; const updatedAlerts = { - ...cloneDeep(originalAlerts), + ...cloneDeep(existingAlerts), '1': newAlert, }; @@ -120,8 +132,14 @@ describe('processAlerts', () => { updatedAlerts['2'].scheduleActions('default', { foo: '1' }); updatedAlerts['3'].scheduleActions('default', { foo: '2' }); - // @ts-expect-error - const { activeAlerts } = processAlerts(updatedAlerts, originalAlerts); + const { activeAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: false, + alertLimit: 10, + }); expect(activeAlerts).toEqual({ '1': updatedAlerts['1'], @@ -135,15 +153,15 @@ describe('processAlerts', () => { const existingAlert1 = new Alert<{}, {}, DefaultActionGroupId>('2'); const existingAlert2 = new Alert<{}, {}, DefaultActionGroupId>('3'); - const originalAlerts = { + const existingAlerts = { '2': existingAlert1, '3': existingAlert2, }; - originalAlerts['2'].replaceState({ start: '1969-12-30T00:00:00.000Z', duration: 33000 }); - originalAlerts['3'].replaceState({ start: '1969-12-31T07:34:00.000Z', duration: 23532 }); + existingAlerts['2'].replaceState({ start: '1969-12-30T00:00:00.000Z', duration: 33000 }); + existingAlerts['3'].replaceState({ start: '1969-12-31T07:34:00.000Z', duration: 23532 }); const updatedAlerts = { - ...cloneDeep(originalAlerts), + ...cloneDeep(existingAlerts), '1': newAlert, }; @@ -151,8 +169,14 @@ describe('processAlerts', () => { updatedAlerts['2'].scheduleActions('default', { foo: '1' }); updatedAlerts['3'].scheduleActions('default', { foo: '2' }); - // @ts-expect-error - const { activeAlerts } = processAlerts(updatedAlerts, originalAlerts); + const { activeAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: false, + alertLimit: 10, + }); expect(activeAlerts).toEqual({ '1': updatedAlerts['1'], @@ -184,13 +208,13 @@ describe('processAlerts', () => { const existingAlert1 = new Alert<{}, {}, DefaultActionGroupId>('2'); const existingAlert2 = new Alert<{}, {}, DefaultActionGroupId>('3'); - const originalAlerts = { + const existingAlerts = { '2': existingAlert1, '3': existingAlert2, }; const updatedAlerts = { - ...cloneDeep(originalAlerts), + ...cloneDeep(existingAlerts), '1': newAlert, }; @@ -198,8 +222,14 @@ describe('processAlerts', () => { updatedAlerts['2'].scheduleActions('default', { foo: '1' }); updatedAlerts['3'].scheduleActions('default', { foo: '2' }); - // @ts-expect-error - const { activeAlerts } = processAlerts(updatedAlerts, originalAlerts); + const { activeAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: false, + alertLimit: 10, + }); expect(activeAlerts).toEqual({ '1': updatedAlerts['1'], @@ -231,23 +261,23 @@ describe('processAlerts', () => { const existingAlert1 = new Alert<{}, {}, DefaultActionGroupId>('2'); const existingAlert2 = new Alert<{}, {}, DefaultActionGroupId>('3'); - const originalAlerts = { + const existingAlerts = { '2': existingAlert1, '3': existingAlert2, }; - originalAlerts['2'].replaceState({ + existingAlerts['2'].replaceState({ stateField1: 'xyz', start: '1969-12-30T00:00:00.000Z', duration: 33000, }); - originalAlerts['3'].replaceState({ + existingAlerts['3'].replaceState({ anotherState: true, start: '1969-12-31T07:34:00.000Z', duration: 23532, }); const updatedAlerts = { - ...cloneDeep(originalAlerts), + ...cloneDeep(existingAlerts), '1': newAlert, }; @@ -255,8 +285,14 @@ describe('processAlerts', () => { updatedAlerts['2'].scheduleActions('default', { foo: '1' }); updatedAlerts['3'].scheduleActions('default', { foo: '2' }); - // @ts-expect-error - const { activeAlerts } = processAlerts(updatedAlerts, originalAlerts); + const { activeAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: false, + alertLimit: 10, + }); expect(activeAlerts).toEqual({ '1': updatedAlerts['1'], @@ -294,18 +330,24 @@ describe('processAlerts', () => { const activeAlert = new Alert<{}, {}, DefaultActionGroupId>('1'); const recoveredAlert = new Alert<{}, {}, DefaultActionGroupId>('2'); - const originalAlerts = { + const existingAlerts = { '1': activeAlert, '2': recoveredAlert, }; - const updatedAlerts = cloneDeep(originalAlerts); + const updatedAlerts = cloneDeep(existingAlerts); updatedAlerts['1'].scheduleActions('default', { foo: '1' }); updatedAlerts['2'].setContext({ foo: '2' }); - // @ts-expect-error - const { recoveredAlerts } = processAlerts(updatedAlerts, originalAlerts); + const { recoveredAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: false, + alertLimit: 10, + }); expect(recoveredAlerts).toEqual({ '2': updatedAlerts['2'] }); }); @@ -314,19 +356,25 @@ describe('processAlerts', () => { const activeAlert = new Alert<{}, {}, DefaultActionGroupId>('1'); const notRecoveredAlert = new Alert<{}, {}, DefaultActionGroupId>('2'); - const originalAlerts = { + const existingAlerts = { '1': activeAlert, }; const updatedAlerts = { - ...cloneDeep(originalAlerts), + ...cloneDeep(existingAlerts), '2': notRecoveredAlert, }; updatedAlerts['1'].scheduleActions('default', { foo: '1' }); - // @ts-expect-error - const { recoveredAlerts } = processAlerts(updatedAlerts, originalAlerts); + const { recoveredAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: false, + alertLimit: 10, + }); expect(recoveredAlerts).toEqual({}); }); @@ -336,20 +384,26 @@ describe('processAlerts', () => { const recoveredAlert1 = new Alert<{}, {}, DefaultActionGroupId>('2'); const recoveredAlert2 = new Alert<{}, {}, DefaultActionGroupId>('3'); - const originalAlerts = { + const existingAlerts = { '1': activeAlert, '2': recoveredAlert1, '3': recoveredAlert2, }; - originalAlerts['2'].replaceState({ start: '1969-12-30T00:00:00.000Z', duration: 33000 }); - originalAlerts['3'].replaceState({ start: '1969-12-31T07:34:00.000Z', duration: 23532 }); + existingAlerts['2'].replaceState({ start: '1969-12-30T00:00:00.000Z', duration: 33000 }); + existingAlerts['3'].replaceState({ start: '1969-12-31T07:34:00.000Z', duration: 23532 }); - const updatedAlerts = cloneDeep(originalAlerts); + const updatedAlerts = cloneDeep(existingAlerts); updatedAlerts['1'].scheduleActions('default', { foo: '1' }); - // @ts-expect-error - const { recoveredAlerts } = processAlerts(updatedAlerts, originalAlerts); + const { recoveredAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: false, + alertLimit: 10, + }); expect(recoveredAlerts).toEqual({ '2': updatedAlerts['2'], '3': updatedAlerts['3'] }); @@ -377,17 +431,23 @@ describe('processAlerts', () => { const recoveredAlert1 = new Alert<{}, {}, DefaultActionGroupId>('2'); const recoveredAlert2 = new Alert<{}, {}, DefaultActionGroupId>('3'); - const originalAlerts = { + const existingAlerts = { '1': activeAlert, '2': recoveredAlert1, '3': recoveredAlert2, }; - const updatedAlerts = cloneDeep(originalAlerts); + const updatedAlerts = cloneDeep(existingAlerts); updatedAlerts['1'].scheduleActions('default', { foo: '1' }); - // @ts-expect-error - const { recoveredAlerts } = processAlerts(updatedAlerts, originalAlerts); + const { recoveredAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: false, + alertLimit: 10, + }); expect(recoveredAlerts).toEqual({ '2': updatedAlerts['2'], '3': updatedAlerts['3'] }); @@ -410,4 +470,156 @@ describe('processAlerts', () => { expect(recoveredAlert2State.end).not.toBeDefined(); }); }); + + describe('when hasReachedAlertLimit is true', () => { + test('does not calculate recovered alerts', () => { + const existingAlert1 = new Alert<{}, {}, DefaultActionGroupId>('1'); + const existingAlert2 = new Alert<{}, {}, DefaultActionGroupId>('2'); + const existingAlert3 = new Alert<{}, {}, DefaultActionGroupId>('3'); + const existingAlert4 = new Alert<{}, {}, DefaultActionGroupId>('4'); + const existingAlert5 = new Alert<{}, {}, DefaultActionGroupId>('5'); + const newAlert6 = new Alert<{}, {}, DefaultActionGroupId>('6'); + const newAlert7 = new Alert<{}, {}, DefaultActionGroupId>('7'); + + const existingAlerts = { + '1': existingAlert1, + '2': existingAlert2, + '3': existingAlert3, + '4': existingAlert4, + '5': existingAlert5, + }; + + const updatedAlerts = { + ...cloneDeep(existingAlerts), + '6': newAlert6, + '7': newAlert7, + }; + + updatedAlerts['1'].scheduleActions('default', { foo: '1' }); + updatedAlerts['2'].scheduleActions('default', { foo: '1' }); + updatedAlerts['3'].scheduleActions('default', { foo: '2' }); + updatedAlerts['4'].scheduleActions('default', { foo: '2' }); + // intentionally not scheduling actions for alert "5" + updatedAlerts['6'].scheduleActions('default', { foo: '2' }); + updatedAlerts['7'].scheduleActions('default', { foo: '2' }); + + const { recoveredAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: true, + alertLimit: 7, + }); + + expect(recoveredAlerts).toEqual({}); + }); + + test('persists existing alerts', () => { + const existingAlert1 = new Alert<{}, {}, DefaultActionGroupId>('1'); + const existingAlert2 = new Alert<{}, {}, DefaultActionGroupId>('2'); + const existingAlert3 = new Alert<{}, {}, DefaultActionGroupId>('3'); + const existingAlert4 = new Alert<{}, {}, DefaultActionGroupId>('4'); + const existingAlert5 = new Alert<{}, {}, DefaultActionGroupId>('5'); + + const existingAlerts = { + '1': existingAlert1, + '2': existingAlert2, + '3': existingAlert3, + '4': existingAlert4, + '5': existingAlert5, + }; + + const updatedAlerts = cloneDeep(existingAlerts); + + updatedAlerts['1'].scheduleActions('default', { foo: '1' }); + updatedAlerts['2'].scheduleActions('default', { foo: '1' }); + updatedAlerts['3'].scheduleActions('default', { foo: '2' }); + updatedAlerts['4'].scheduleActions('default', { foo: '2' }); + // intentionally not scheduling actions for alert "5" + + const { activeAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: true, + alertLimit: 7, + }); + + expect(activeAlerts).toEqual({ + '1': updatedAlerts['1'], + '2': updatedAlerts['2'], + '3': updatedAlerts['3'], + '4': updatedAlerts['4'], + '5': existingAlert5, + }); + }); + + test('adds new alerts up to max allowed', () => { + const MAX_ALERTS = 7; + const existingAlert1 = new Alert<{}, {}, DefaultActionGroupId>('1'); + const existingAlert2 = new Alert<{}, {}, DefaultActionGroupId>('2'); + const existingAlert3 = new Alert<{}, {}, DefaultActionGroupId>('3'); + const existingAlert4 = new Alert<{}, {}, DefaultActionGroupId>('4'); + const existingAlert5 = new Alert<{}, {}, DefaultActionGroupId>('5'); + const newAlert6 = new Alert<{}, {}, DefaultActionGroupId>('6'); + const newAlert7 = new Alert<{}, {}, DefaultActionGroupId>('7'); + const newAlert8 = new Alert<{}, {}, DefaultActionGroupId>('8'); + const newAlert9 = new Alert<{}, {}, DefaultActionGroupId>('9'); + const newAlert10 = new Alert<{}, {}, DefaultActionGroupId>('10'); + + const existingAlerts = { + '1': existingAlert1, + '2': existingAlert2, + '3': existingAlert3, + '4': existingAlert4, + '5': existingAlert5, + }; + + const updatedAlerts = { + ...cloneDeep(existingAlerts), + '6': newAlert6, + '7': newAlert7, + '8': newAlert8, + '9': newAlert9, + '10': newAlert10, + }; + + updatedAlerts['1'].scheduleActions('default', { foo: '1' }); + updatedAlerts['2'].scheduleActions('default', { foo: '1' }); + updatedAlerts['3'].scheduleActions('default', { foo: '2' }); + updatedAlerts['4'].scheduleActions('default', { foo: '2' }); + // intentionally not scheduling actions for alert "5" + updatedAlerts['6'].scheduleActions('default', { foo: '2' }); + updatedAlerts['7'].scheduleActions('default', { foo: '2' }); + updatedAlerts['8'].scheduleActions('default', { foo: '2' }); + updatedAlerts['9'].scheduleActions('default', { foo: '2' }); + updatedAlerts['10'].scheduleActions('default', { foo: '2' }); + + const { activeAlerts, newAlerts } = processAlerts({ + // @ts-expect-error + alerts: updatedAlerts, + // @ts-expect-error + existingAlerts, + hasReachedAlertLimit: true, + alertLimit: MAX_ALERTS, + }); + + expect(Object.keys(activeAlerts).length).toEqual(MAX_ALERTS); + expect(activeAlerts).toEqual({ + '1': updatedAlerts['1'], + '2': updatedAlerts['2'], + '3': updatedAlerts['3'], + '4': updatedAlerts['4'], + '5': existingAlert5, + '6': newAlert6, + '7': newAlert7, + }); + expect(newAlerts).toEqual({ + '6': newAlert6, + '7': newAlert7, + }); + }); + }); }); diff --git a/x-pack/plugins/alerting/server/lib/process_alerts.ts b/x-pack/plugins/alerting/server/lib/process_alerts.ts index f4af401e5113c..c0352a06f2eba 100644 --- a/x-pack/plugins/alerting/server/lib/process_alerts.ts +++ b/x-pack/plugins/alerting/server/lib/process_alerts.ts @@ -6,9 +6,19 @@ */ import { millisToNanos } from '@kbn/event-log-plugin/server'; +import { cloneDeep } from 'lodash'; import { Alert } from '../alert'; import { AlertInstanceState, AlertInstanceContext } from '../types'; +interface ProcessAlertsOpts< + State extends AlertInstanceState, + Context extends AlertInstanceContext +> { + alerts: Record>; + existingAlerts: Record>; + hasReachedAlertLimit: boolean; + alertLimit: number; +} interface ProcessAlertsResult< State extends AlertInstanceState, Context extends AlertInstanceContext, @@ -25,11 +35,32 @@ export function processAlerts< Context extends AlertInstanceContext, ActionGroupIds extends string, RecoveryActionGroupId extends string +>({ + alerts, + existingAlerts, + hasReachedAlertLimit, + alertLimit, +}: ProcessAlertsOpts): ProcessAlertsResult< + State, + Context, + ActionGroupIds, + RecoveryActionGroupId +> { + return hasReachedAlertLimit + ? processAlertsLimitReached(alerts, existingAlerts, alertLimit) + : processAlertsHelper(alerts, existingAlerts); +} + +function processAlertsHelper< + State extends AlertInstanceState, + Context extends AlertInstanceContext, + ActionGroupIds extends string, + RecoveryActionGroupId extends string >( alerts: Record>, - originalAlerts: Record> + existingAlerts: Record> ): ProcessAlertsResult { - const originalAlertIds = new Set(Object.keys(originalAlerts)); + const existingAlertIds = new Set(Object.keys(existingAlerts)); const currentTime = new Date().toISOString(); const newAlerts: Record> = {}; @@ -43,7 +74,7 @@ export function processAlerts< activeAlerts[id] = alerts[id]; // if this alert did not exist in previous run, it is considered "new" - if (!originalAlertIds.has(id)) { + if (!existingAlertIds.has(id)) { newAlerts[id] = alerts[id]; // Inject start time into alert state for new alerts @@ -52,7 +83,7 @@ export function processAlerts< } else { // this alert did exist in previous run // calculate duration to date for active alerts - const state = originalAlerts[id].getState(); + const state = existingAlerts[id].getState(); const durationInMs = new Date(currentTime).valueOf() - new Date(state.start as string).valueOf(); const duration = state.start ? millisToNanos(durationInMs) : undefined; @@ -62,7 +93,7 @@ export function processAlerts< ...(duration !== undefined ? { duration } : {}), }); } - } else if (originalAlertIds.has(id)) { + } else if (existingAlertIds.has(id)) { recoveredAlerts[id] = alerts[id]; // Inject end time into alert state of recovered alerts @@ -80,3 +111,76 @@ export function processAlerts< } return { recoveredAlerts, newAlerts, activeAlerts }; } + +function processAlertsLimitReached< + State extends AlertInstanceState, + Context extends AlertInstanceContext, + ActionGroupIds extends string, + RecoveryActionGroupId extends string +>( + alerts: Record>, + existingAlerts: Record>, + alertLimit: number +): ProcessAlertsResult { + const existingAlertIds = new Set(Object.keys(existingAlerts)); + + // When the alert limit has been reached, + // - skip determination of recovered alerts + // - pass through all existing alerts as active + // - add any new alerts, up to the max allowed + + const currentTime = new Date().toISOString(); + const newAlerts: Record> = {}; + + // all existing alerts stay active + const activeAlerts: Record> = cloneDeep( + existingAlerts + ); + + // update duration for existing alerts + for (const id in activeAlerts) { + if (activeAlerts.hasOwnProperty(id)) { + if (alerts.hasOwnProperty(id)) { + activeAlerts[id] = alerts[id]; + } + const state = existingAlerts[id].getState(); + const durationInMs = + new Date(currentTime).valueOf() - new Date(state.start as string).valueOf(); + const duration = state.start ? millisToNanos(durationInMs) : undefined; + activeAlerts[id].replaceState({ + ...state, + ...(state.start ? { start: state.start } : {}), + ...(duration !== undefined ? { duration } : {}), + }); + } + } + + function hasCapacityForNewAlerts() { + return Object.keys(activeAlerts).length < alertLimit; + } + + // if we don't have capacity for new alerts, return + if (!hasCapacityForNewAlerts()) { + return { recoveredAlerts: {}, newAlerts: {}, activeAlerts }; + } + + // look for new alerts and add until we hit capacity + for (const id in alerts) { + if (alerts.hasOwnProperty(id) && alerts[id].hasScheduledActions()) { + // if this alert did not exist in previous run, it is considered "new" + if (!existingAlertIds.has(id)) { + activeAlerts[id] = alerts[id]; + newAlerts[id] = alerts[id]; + + // Inject start time into alert state for new alerts + const state = newAlerts[id].getState(); + newAlerts[id].replaceState({ ...state, start: currentTime, duration: '0' }); + + if (!hasCapacityForNewAlerts()) { + break; + } + } + } + } + return { recoveredAlerts: {}, newAlerts, activeAlerts }; +} diff --git a/x-pack/plugins/alerting/server/lib/rule_execution_status.test.ts b/x-pack/plugins/alerting/server/lib/rule_execution_status.test.ts index 8551bb00287c7..69c90ed812549 100644 --- a/x-pack/plugins/alerting/server/lib/rule_execution_status.test.ts +++ b/x-pack/plugins/alerting/server/lib/rule_execution_status.test.ts @@ -31,6 +31,7 @@ const executionMetrics = { numberOfActiveAlerts: 2, numberOfNewAlerts: 3, numberOfRecoveredAlerts: 13, + hasReachedAlertLimit: false, triggeredActionsStatus: ActionsCompletion.COMPLETE, }; @@ -48,6 +49,7 @@ describe('RuleExecutionStatus', () => { expect(received.numberOfActiveAlerts).toEqual(expected.numberOfActiveAlerts); expect(received.numberOfRecoveredAlerts).toEqual(expected.numberOfRecoveredAlerts); expect(received.numberOfNewAlerts).toEqual(expected.numberOfNewAlerts); + expect(received.hasReachedAlertLimit).toEqual(expected.hasReachedAlertLimit); expect(received.triggeredActionsStatus).toEqual(expected.triggeredActionsStatus); } @@ -89,7 +91,7 @@ describe('RuleExecutionStatus', () => { testExpectedMetrics(metrics!, executionMetrics); }); - test('task state with warning', () => { + test('task state with max executable actions warning', () => { const { status, metrics } = executionStatusFromState({ alertInstances: { a: {} }, metrics: { ...executionMetrics, triggeredActionsStatus: ActionsCompletion.PARTIAL }, @@ -107,6 +109,25 @@ describe('RuleExecutionStatus', () => { triggeredActionsStatus: ActionsCompletion.PARTIAL, }); }); + + test('task state with max alerts warning', () => { + const { status, metrics } = executionStatusFromState({ + alertInstances: { a: {} }, + metrics: { ...executionMetrics, hasReachedAlertLimit: true }, + }); + checkDateIsNearNow(status.lastExecutionDate); + expect(status.warning).toEqual({ + message: translations.taskRunner.warning.maxAlerts, + reason: RuleExecutionStatusWarningReasons.MAX_ALERTS, + }); + expect(status.status).toBe('warning'); + expect(status.error).toBe(undefined); + + testExpectedMetrics(metrics!, { + ...executionMetrics, + hasReachedAlertLimit: true, + }); + }); }); describe('executionStatusFromError()', () => { diff --git a/x-pack/plugins/alerting/server/lib/rule_execution_status.ts b/x-pack/plugins/alerting/server/lib/rule_execution_status.ts index 28eaf24ef8a2d..c852ca5899420 100644 --- a/x-pack/plugins/alerting/server/lib/rule_execution_status.ts +++ b/x-pack/plugins/alerting/server/lib/rule_execution_status.ts @@ -30,26 +30,31 @@ export function executionStatusFromState( ): IExecutionStatusAndMetrics { const alertIds = Object.keys(stateWithMetrics.alertInstances ?? {}); - const hasIncompleteAlertExecution = - stateWithMetrics.metrics.triggeredActionsStatus === ActionsCompletion.PARTIAL; - let status: RuleExecutionStatuses = alertIds.length === 0 ? RuleExecutionStatusValues[0] : RuleExecutionStatusValues[1]; - if (hasIncompleteAlertExecution) { + // Check for warning states + let warning = null; + // We only have a single warning field so prioritizing the alert circuit breaker over the actions circuit breaker + if (stateWithMetrics.metrics.hasReachedAlertLimit) { + status = RuleExecutionStatusValues[5]; + warning = { + reason: RuleExecutionStatusWarningReasons.MAX_ALERTS, + message: translations.taskRunner.warning.maxAlerts, + }; + } else if (stateWithMetrics.metrics.triggeredActionsStatus === ActionsCompletion.PARTIAL) { status = RuleExecutionStatusValues[5]; + warning = { + reason: RuleExecutionStatusWarningReasons.MAX_EXECUTABLE_ACTIONS, + message: translations.taskRunner.warning.maxExecutableActions, + }; } return { status: { lastExecutionDate: lastExecutionDate ?? new Date(), status, - ...(hasIncompleteAlertExecution && { - warning: { - reason: RuleExecutionStatusWarningReasons.MAX_EXECUTABLE_ACTIONS, - message: translations.taskRunner.warning.maxExecutableActions, - }, - }), + ...(warning ? { warning } : {}), }, metrics: stateWithMetrics.metrics, }; diff --git a/x-pack/plugins/alerting/server/lib/rule_run_metrics_store.test.ts b/x-pack/plugins/alerting/server/lib/rule_run_metrics_store.test.ts index b27dc37a459e0..f70a36cba0775 100644 --- a/x-pack/plugins/alerting/server/lib/rule_run_metrics_store.test.ts +++ b/x-pack/plugins/alerting/server/lib/rule_run_metrics_store.test.ts @@ -24,6 +24,7 @@ describe('RuleRunMetricsStore', () => { expect(ruleRunMetricsStore.getNumberOfRecoveredAlerts()).toBe(0); expect(ruleRunMetricsStore.getNumberOfNewAlerts()).toBe(0); expect(ruleRunMetricsStore.getStatusByConnectorType('any')).toBe(undefined); + expect(ruleRunMetricsStore.getHasReachedAlertLimit()).toBe(false); }); test('sets and returns numSearches', () => { @@ -77,6 +78,11 @@ describe('RuleRunMetricsStore', () => { expect(ruleRunMetricsStore.getTriggeredActionsStatus()).toBe(ActionsCompletion.PARTIAL); }); + test('sets and returns hasReachedAlertLimit', () => { + ruleRunMetricsStore.setHasReachedAlertLimit(true); + expect(ruleRunMetricsStore.getHasReachedAlertLimit()).toBe(true); + }); + test('gets metrics', () => { expect(ruleRunMetricsStore.getMetrics()).toEqual({ triggeredActionsStatus: 'partial', @@ -88,6 +94,7 @@ describe('RuleRunMetricsStore', () => { numberOfRecoveredAlerts: 11, numberOfTriggeredActions: 5, totalSearchDurationMs: 2, + hasReachedAlertLimit: true, }); }); diff --git a/x-pack/plugins/alerting/server/lib/rule_run_metrics_store.ts b/x-pack/plugins/alerting/server/lib/rule_run_metrics_store.ts index 97fa14214e4f7..edcba1944dc63 100644 --- a/x-pack/plugins/alerting/server/lib/rule_run_metrics_store.ts +++ b/x-pack/plugins/alerting/server/lib/rule_run_metrics_store.ts @@ -18,6 +18,7 @@ interface State { numberOfActiveAlerts: number; numberOfRecoveredAlerts: number; numberOfNewAlerts: number; + hasReachedAlertLimit: boolean; connectorTypes: { [key: string]: { triggeredActionsStatus: ActionsCompletion; @@ -40,6 +41,7 @@ export class RuleRunMetricsStore { numberOfActiveAlerts: 0, numberOfRecoveredAlerts: 0, numberOfNewAlerts: 0, + hasReachedAlertLimit: false, connectorTypes: {}, }; @@ -84,6 +86,9 @@ export class RuleRunMetricsStore { triggeredActionsStatus: this.getTriggeredActionsStatus(), }; }; + public getHasReachedAlertLimit = () => { + return this.state.hasReachedAlertLimit; + }; // Setters public setNumSearches = (numSearches: number) => { @@ -119,6 +124,9 @@ export class RuleRunMetricsStore { }) => { set(this.state, `connectorTypes["${actionTypeId}"].triggeredActionsStatus`, status); }; + public setHasReachedAlertLimit = (hasReachedAlertLimit: boolean) => { + this.state.hasReachedAlertLimit = hasReachedAlertLimit; + }; // Checkers public hasReachedTheExecutableActionsLimit = (actionsConfigMap: ActionsConfigMap): boolean => diff --git a/x-pack/plugins/alerting/server/mocks.ts b/x-pack/plugins/alerting/server/mocks.ts index fd554783111d2..7abdf04296beb 100644 --- a/x-pack/plugins/alerting/server/mocks.ts +++ b/x-pack/plugins/alerting/server/mocks.ts @@ -104,6 +104,7 @@ const createRuleExecutorServicesMock = < return { alertFactory: { create: jest.fn().mockReturnValue(alertFactoryMockCreate), + hasReachedAlertLimit: jest.fn().mockReturnValue(false), done: jest.fn().mockReturnValue(alertFactoryMockDone), }, savedObjectsClient: savedObjectsClientMock.create(), diff --git a/x-pack/plugins/alerting/server/plugin.test.ts b/x-pack/plugins/alerting/server/plugin.test.ts index 244a8a56ff9e1..87ed23c66ba3c 100644 --- a/x-pack/plugins/alerting/server/plugin.test.ts +++ b/x-pack/plugins/alerting/server/plugin.test.ts @@ -40,6 +40,9 @@ const generateAlertingConfig = (): AlertingConfig => ({ actions: { max: 1000, }, + alerts: { + max: 1000, + }, }, }, }); diff --git a/x-pack/plugins/alerting/server/plugin.ts b/x-pack/plugins/alerting/server/plugin.ts index 83d9c4f99ded8..7450dcb1a45d0 100644 --- a/x-pack/plugins/alerting/server/plugin.ts +++ b/x-pack/plugins/alerting/server/plugin.ts @@ -442,6 +442,7 @@ export class AlertingPlugin { supportsEphemeralTasks: plugins.taskManager.supportsEphemeralTasks(), maxEphemeralActionsPerRule: this.config.maxEphemeralActionsPerAlert, cancelAlertsOnRuleTimeout: this.config.cancelAlertsOnRuleTimeout, + maxAlerts: this.config.rules.run.alerts.max, actionsConfigMap: getActionsConfigMap(this.config.rules.run.actions), usageCounter: this.usageCounter, }); diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts index ea94d7809bfc9..13215b9e2cb20 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts @@ -143,6 +143,7 @@ describe('Task Runner', () => { kibanaBaseUrl: 'https://localhost:5601', supportsEphemeralTasks: false, maxEphemeralActionsPerRule: 10, + maxAlerts: 1000, cancelAlertsOnRuleTimeout: true, usageCounter: mockUsageCounter, actionsConfigMap: { @@ -262,7 +263,7 @@ describe('Task Runner', () => { ); expect(logger.debug).nthCalledWith( 3, - 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":0,"numberOfGeneratedActions":0,"numberOfActiveAlerts":0,"numberOfRecoveredAlerts":0,"numberOfNewAlerts":0,"triggeredActionsStatus":"complete"}' + 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":0,"numberOfGeneratedActions":0,"numberOfActiveAlerts":0,"numberOfRecoveredAlerts":0,"numberOfNewAlerts":0,"hasReachedAlertLimit":false,"triggeredActionsStatus":"complete"}' ); testAlertingEventLogCalls({ status: 'ok' }); @@ -343,7 +344,7 @@ describe('Task Runner', () => { ); expect(logger.debug).nthCalledWith( 4, - 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":1,"numberOfGeneratedActions":1,"numberOfActiveAlerts":1,"numberOfRecoveredAlerts":0,"numberOfNewAlerts":1,"triggeredActionsStatus":"complete"}' + 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":1,"numberOfGeneratedActions":1,"numberOfActiveAlerts":1,"numberOfRecoveredAlerts":0,"numberOfNewAlerts":1,"hasReachedAlertLimit":false,"triggeredActionsStatus":"complete"}' ); testAlertingEventLogCalls({ @@ -430,7 +431,7 @@ describe('Task Runner', () => { ); expect(logger.debug).nthCalledWith( 5, - 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":0,"numberOfGeneratedActions":0,"numberOfActiveAlerts":1,"numberOfRecoveredAlerts":0,"numberOfNewAlerts":1,"triggeredActionsStatus":"complete"}' + 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":0,"numberOfGeneratedActions":0,"numberOfActiveAlerts":1,"numberOfRecoveredAlerts":0,"numberOfNewAlerts":1,"hasReachedAlertLimit":false,"triggeredActionsStatus":"complete"}' ); testAlertingEventLogCalls({ @@ -604,7 +605,7 @@ describe('Task Runner', () => { ); expect(logger.debug).nthCalledWith( 5, - 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":1,"numberOfGeneratedActions":1,"numberOfActiveAlerts":2,"numberOfRecoveredAlerts":0,"numberOfNewAlerts":2,"triggeredActionsStatus":"complete"}' + 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":1,"numberOfGeneratedActions":1,"numberOfActiveAlerts":2,"numberOfRecoveredAlerts":0,"numberOfNewAlerts":2,"hasReachedAlertLimit":false,"triggeredActionsStatus":"complete"}' ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); } @@ -1119,7 +1120,7 @@ describe('Task Runner', () => { ); expect(logger.debug).nthCalledWith( 5, - 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":2,"numberOfGeneratedActions":2,"numberOfActiveAlerts":1,"numberOfRecoveredAlerts":1,"numberOfNewAlerts":0,"triggeredActionsStatus":"complete"}' + 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":2,"numberOfGeneratedActions":2,"numberOfActiveAlerts":1,"numberOfRecoveredAlerts":1,"numberOfNewAlerts":0,"hasReachedAlertLimit":false,"triggeredActionsStatus":"complete"}' ); testAlertingEventLogCalls({ @@ -1232,7 +1233,7 @@ describe('Task Runner', () => { ); expect(logger.debug).nthCalledWith( 5, - `ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":2,"numberOfGeneratedActions":2,"numberOfActiveAlerts":1,"numberOfRecoveredAlerts":1,"numberOfNewAlerts":0,"triggeredActionsStatus":"complete"}` + `ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":2,"numberOfGeneratedActions":2,"numberOfActiveAlerts":1,"numberOfRecoveredAlerts":1,"numberOfNewAlerts":0,"hasReachedAlertLimit":false,"triggeredActionsStatus":"complete"}` ); testAlertingEventLogCalls({ @@ -2362,7 +2363,7 @@ describe('Task Runner', () => { ); expect(logger.debug).nthCalledWith( 3, - 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":0,"numberOfGeneratedActions":0,"numberOfActiveAlerts":0,"numberOfRecoveredAlerts":0,"numberOfNewAlerts":0,"triggeredActionsStatus":"complete"}' + 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":0,"numberOfGeneratedActions":0,"numberOfActiveAlerts":0,"numberOfRecoveredAlerts":0,"numberOfNewAlerts":0,"hasReachedAlertLimit":false,"triggeredActionsStatus":"complete"}' ); testAlertingEventLogCalls({ @@ -2859,6 +2860,7 @@ describe('Task Runner', () => { setRuleName = true, logAlert = 0, logAction = 0, + hasReachedAlertLimit = false, }: { status: string; ruleContext?: RuleContextOpts; @@ -2873,6 +2875,7 @@ describe('Task Runner', () => { logAction?: number; errorReason?: string; errorMessage?: string; + hasReachedAlertLimit?: boolean; }) { expect(alertingEventLogger.initialize).toHaveBeenCalledWith(ruleContext); expect(alertingEventLogger.start).toHaveBeenCalled(); @@ -2905,6 +2908,7 @@ describe('Task Runner', () => { numberOfRecoveredAlerts: recoveredAlerts, numberOfTriggeredActions: triggeredActions, totalSearchDurationMs: 23423, + hasReachedAlertLimit, triggeredActionsStatus: 'partial', }, status: { @@ -2927,6 +2931,7 @@ describe('Task Runner', () => { numberOfRecoveredAlerts: recoveredAlerts, numberOfTriggeredActions: triggeredActions, totalSearchDurationMs: 23423, + hasReachedAlertLimit, triggeredActionsStatus: 'complete', }, status: { diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.ts index 16d2dac684e47..d5aaacbacc16a 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.ts @@ -108,6 +108,7 @@ export class TaskRunner< private readonly executionId: string; private readonly ruleTypeRegistry: RuleTypeRegistry; private readonly inMemoryMetrics: InMemoryMetrics; + private readonly maxAlerts: number; private alertingEventLogger: AlertingEventLogger; private usageCounter?: UsageCounter; private searchAbortController: AbortController; @@ -138,6 +139,7 @@ export class TaskRunner< this.cancelled = false; this.executionId = uuid.v4(); this.inMemoryMetrics = inMemoryMetrics; + this.maxAlerts = context.maxAlerts; this.alertingEventLogger = new AlertingEventLogger(this.context.eventLogger); } @@ -228,22 +230,26 @@ export class TaskRunner< executionHandler: ExecutionHandler, ruleRunMetricsStore: RuleRunMetricsStore ) { - const { - actionGroup, - subgroup: actionSubgroup, - context, - state, - } = alert.getScheduledActionOptions()!; - alert.updateLastScheduledActions(actionGroup, actionSubgroup); - alert.unscheduleActions(); - return executionHandler({ - actionGroup, - actionSubgroup, - context, - state, - alertId, - ruleRunMetricsStore, - }); + if (alert.hasScheduledActions()) { + const { + actionGroup, + subgroup: actionSubgroup, + context, + state, + } = alert.getScheduledActionOptions()!; + alert.updateLastScheduledActions(actionGroup, actionSubgroup); + alert.unscheduleActions(); + return executionHandler({ + actionGroup, + actionSubgroup, + context, + state, + alertId, + ruleRunMetricsStore, + }); + } + + return Promise.resolve(); } private async executeRule( @@ -279,6 +285,8 @@ export class TaskRunner< }, } = this.taskInstance; + const ruleRunMetricsStore = new RuleRunMetricsStore(); + const executionHandler = this.getExecutionHandler( ruleId, rule.name, @@ -325,6 +333,16 @@ export class TaskRunner< searchSourceClient, }); + const alertFactory = createAlertFactory< + State, + Context, + WithoutReservedActionGroups + >({ + alerts, + logger: this.logger, + maxAlerts: this.maxAlerts, + canSetRecoveryContext: ruleType.doesSetRecoveryContext ?? false, + }); let updatedRuleTypeState: void | Record; try { const ctx = { @@ -349,15 +367,7 @@ export class TaskRunner< searchSourceClient: wrappedSearchSourceClient.searchSourceClient, uiSettingsClient: this.context.uiSettings.asScopedToClient(savedObjectsClient), scopedClusterClient: wrappedScopedClusterClient.client(), - alertFactory: createAlertFactory< - State, - Context, - WithoutReservedActionGroups - >({ - alerts, - logger: this.logger, - canSetRecoveryContext: ruleType.doesSetRecoveryContext ?? false, - }), + alertFactory, shouldWriteAlerts: () => this.shouldLogAndScheduleActionsForAlerts(), shouldStopExecution: () => this.cancelled, }, @@ -391,15 +401,23 @@ export class TaskRunner< }) ); } catch (err) { - this.alertingEventLogger.setExecutionFailed( - `rule execution failure: ${ruleLabel}`, - err.message - ); - this.logger.error(err, { - tags: [this.ruleType.id, ruleId, 'rule-run-failed'], - error: { stack_trace: err.stack }, - }); - throw new ErrorWithReason(RuleExecutionStatusErrorReasons.Execute, err); + // Check if this error is due to reaching the alert limit + if (alertFactory.hasReachedAlertLimit()) { + this.logger.warn( + `rule execution generated greater than ${this.maxAlerts} alerts: ${ruleLabel}` + ); + ruleRunMetricsStore.setHasReachedAlertLimit(true); + } else { + this.alertingEventLogger.setExecutionFailed( + `rule execution failure: ${ruleLabel}`, + err.message + ); + this.logger.error(err, { + tags: [this.ruleType.id, ruleId, 'rule-run-failed'], + error: { stack_trace: err.stack }, + }); + throw new ErrorWithReason(RuleExecutionStatusErrorReasons.Execute, err); + } } this.alertingEventLogger.setExecutionSucceeded(`rule executed: ${ruleLabel}`); @@ -415,7 +433,6 @@ export class TaskRunner< scopedClusterClientMetrics.esSearchDurationMs + searchSourceClientMetrics.esSearchDurationMs, }; - const ruleRunMetricsStore = new RuleRunMetricsStore(); ruleRunMetricsStore.setNumSearches(searchMetrics.numSearches); ruleRunMetricsStore.setTotalSearchDurationMs(searchMetrics.totalSearchDurationMs); @@ -426,7 +443,12 @@ export class TaskRunner< Context, ActionGroupIds, RecoveryActionGroupId - >(alerts, originalAlerts); + >({ + alerts, + existingAlerts: originalAlerts, + hasReachedAlertLimit: alertFactory.hasReachedAlertLimit(), + alertLimit: this.maxAlerts, + }); logAlerts({ logger: this.logger, diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts index fb2d1be3a3872..088ef6f9a1be4 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts @@ -120,6 +120,7 @@ describe('Task Runner Cancel', () => { kibanaBaseUrl: 'https://localhost:5601', supportsEphemeralTasks: false, maxEphemeralActionsPerRule: 10, + maxAlerts: 1000, cancelAlertsOnRuleTimeout: true, usageCounter: mockUsageCounter, actionsConfigMap: { @@ -414,7 +415,7 @@ describe('Task Runner Cancel', () => { ); expect(logger.debug).nthCalledWith( 7, - 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":1,"numberOfGeneratedActions":1,"numberOfActiveAlerts":1,"numberOfRecoveredAlerts":0,"numberOfNewAlerts":1,"triggeredActionsStatus":"complete"}' + 'ruleRunMetrics for test:1: {"numSearches":3,"totalSearchDurationMs":23423,"esSearchDurationMs":33,"numberOfTriggeredActions":1,"numberOfGeneratedActions":1,"numberOfActiveAlerts":1,"numberOfRecoveredAlerts":0,"numberOfNewAlerts":1,"hasReachedAlertLimit":false,"triggeredActionsStatus":"complete"}' ); } @@ -428,6 +429,7 @@ describe('Task Runner Cancel', () => { status, logAlert = 0, logAction = 0, + hasReachedAlertLimit = false, }: { status: string; ruleContext?: RuleContextOpts; @@ -439,6 +441,7 @@ describe('Task Runner Cancel', () => { setRuleName?: boolean; logAlert?: number; logAction?: number; + hasReachedAlertLimit?: boolean; }) { expect(alertingEventLogger.initialize).toHaveBeenCalledWith(ruleContext); expect(alertingEventLogger.start).toHaveBeenCalled(); @@ -455,6 +458,7 @@ describe('Task Runner Cancel', () => { numberOfRecoveredAlerts: recoveredAlerts, numberOfTriggeredActions: triggeredActions, totalSearchDurationMs: 23423, + hasReachedAlertLimit, triggeredActionsStatus: 'complete', }, status: { diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner_factory.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner_factory.test.ts index e787617800356..9ecc361ca4af4 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner_factory.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner_factory.test.ts @@ -98,6 +98,7 @@ describe('Task Runner Factory', () => { kibanaBaseUrl: 'https://localhost:5601', supportsEphemeralTasks: true, maxEphemeralActionsPerRule: 10, + maxAlerts: 1000, cancelAlertsOnRuleTimeout: true, executionContext, usageCounter: mockUsageCounter, diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner_factory.ts b/x-pack/plugins/alerting/server/task_runner/task_runner_factory.ts index 09fe8cb030c40..a5ca6973cda27 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner_factory.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner_factory.ts @@ -53,6 +53,7 @@ export interface TaskRunnerContext { kibanaBaseUrl: string | undefined; supportsEphemeralTasks: boolean; maxEphemeralActionsPerRule: number; + maxAlerts: number; actionsConfigMap: ActionsConfigMap; cancelAlertsOnRuleTimeout: boolean; usageCounter?: UsageCounter; diff --git a/x-pack/plugins/alerting/server/types.ts b/x-pack/plugins/alerting/server/types.ts index 870eeffe6553d..efce3583e1879 100644 --- a/x-pack/plugins/alerting/server/types.ts +++ b/x-pack/plugins/alerting/server/types.ts @@ -80,6 +80,7 @@ export interface RuleExecutorServices< scopedClusterClient: IScopedClusterClient; alertFactory: { create: (id: string) => PublicAlert; + hasReachedAlertLimit: () => boolean; done: () => AlertFactoryDoneUtils; }; shouldWriteAlerts: () => boolean; diff --git a/x-pack/plugins/apm/dev_docs/local_setup.md b/x-pack/plugins/apm/dev_docs/local_setup.md index 24a8db44a3cce..9f3553f3c680c 100644 --- a/x-pack/plugins/apm/dev_docs/local_setup.md +++ b/x-pack/plugins/apm/dev_docs/local_setup.md @@ -44,7 +44,7 @@ elasticsearch.username: kibana_system elasticsearch.password: changeme ``` -Documentation for [Synthtrace](https://github.com/elastic/kibana/blob/main/packages/elastic-apm-synthtrace/README.md) +Documentation for [Synthtrace](https://github.com/elastic/kibana/blob/main/packages/kbn-apm-synthtrace/README.md) ## 2. Cloud-based ES Cluster (internal devs only) diff --git a/x-pack/plugins/apm/dev_docs/testing.md b/x-pack/plugins/apm/dev_docs/testing.md index b3eabc27a515b..c204a3922139f 100644 --- a/x-pack/plugins/apm/dev_docs/testing.md +++ b/x-pack/plugins/apm/dev_docs/testing.md @@ -63,7 +63,7 @@ node scripts/test/api --runner --basic --updateSnapshots **API Test tips** -- For data generation in API tests have a look at the [elastic-apm-synthtrace](../../../../packages/elastic-apm-synthtrace/README.md) package +- For data generation in API tests have a look at the [kbn-apm-synthtrace](../../../../packages/kbn-apm-synthtrace/README.md) package - For debugging access Elasticsearch on http://localhost:9220 and Kibana on http://localhost:5620 (`elastic` / `changeme`) --- @@ -124,4 +124,4 @@ All files with a .stories.tsx extension will be loaded. You can access the devel For end-to-end (e.g. agent -> apm server -> elasticsearch <- kibana) development and testing of Elastic APM please check the the [APM Integration Testing repository](https://github.com/elastic/apm-integration-testing). -Data can also be generated using the [elastic-apm-synthtrace](../../../../packages/elastic-apm-synthtrace/README.md) CLI. +Data can also be generated using the [kbn-apm-synthtrace](../../../../packages/kbn-apm-synthtrace/README.md) CLI. diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/fixtures/synthtrace/opbeans.ts b/x-pack/plugins/apm/ftr_e2e/cypress/fixtures/synthtrace/opbeans.ts index 1d0155bf9b434..1be9873d25c4f 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/fixtures/synthtrace/opbeans.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/fixtures/synthtrace/opbeans.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; export function opbeans({ from, to }: { from: number; to: number }) { const range = timerange(from, to); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/comparison.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/comparison.spec.ts index d3ac4cc0e095f..1a58eb1ca4fda 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/comparison.spec.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/comparison.spec.ts @@ -10,7 +10,7 @@ import { opbeans } from '../../../fixtures/synthtrace/opbeans'; const start = '2021-10-10T00:00:00.000Z'; const end = '2021-10-10T00:15:00.000Z'; -describe('Comparison feature flag', () => { +describe.skip('Comparison feature flag', () => { before(async () => { await synthtrace.index( opbeans({ diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/infrastructure.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/infrastructure.spec.ts deleted file mode 100644 index 99178c810067e..0000000000000 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/infrastructure.spec.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { synthtrace } from '../../../../synthtrace'; -import { opbeans } from '../../../fixtures/synthtrace/opbeans'; - -const serviceOverviewPath = '/app/apm/services/opbeans-python/overview'; - -const start = '2021-10-10T00:00:00.000Z'; -const end = '2021-10-10T00:15:00.000Z'; - -describe('Infrastracture feature flag', () => { - before(async () => { - await synthtrace.index( - opbeans({ - from: new Date(start).getTime(), - to: new Date(end).getTime(), - }) - ); - }); - - after(async () => { - await synthtrace.clean(); - }); - - describe('when infrastracture feature is enabled', () => { - beforeEach(() => { - cy.loginAsEditorUser().then(() => { - // enables infrastructure view feature on advanced settings - cy.updateAdvancedSettings({ - 'observability:enableInfrastructureView': true, - }); - }); - }); - - it('shows infrastructure tab in service overview page', () => { - cy.visit(serviceOverviewPath); - cy.contains('a[role="tab"]', 'Infrastructure'); - }); - }); - - describe('when infrastracture feature is disabled', () => { - beforeEach(() => { - cy.loginAsEditorUser().then(() => { - // enables infrastructure view feature on advanced settings - cy.updateAdvancedSettings({ - 'observability:enableInfrastructureView': false, - }); - }); - }); - - it('hides infrastructure tab in service overview page', () => { - cy.visit(serviceOverviewPath); - cy.contains('a[role="tab"]', 'Infrastructure').should('not.exist'); - }); - }); -}); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/infrastructure/generate_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/infrastructure/generate_data.ts index 1399875791417..52cf6b988f1a1 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/infrastructure/generate_data.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/infrastructure/generate_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; export function generateData({ from, to }: { from: number; to: number }) { const range = timerange(from, to); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/infrastructure/infrastructure_page.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/infrastructure/infrastructure_page.spec.ts index 65f76f7cfd95c..46d654ef2a4aa 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/infrastructure/infrastructure_page.spec.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/infrastructure/infrastructure_page.spec.ts @@ -27,7 +27,7 @@ const nodeServiceInfraPageHref = url.format({ query: { rangeFrom: start, rangeTo: end }, }); -describe('Infrastructure page', () => { +describe.skip('Infrastructure page', () => { before(async () => { await synthtrace.index( generateData({ diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/settings/agent_configurations.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/settings/agent_configurations.spec.ts index 4661ea67ae2ab..a2f5e055e80a8 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/settings/agent_configurations.spec.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/settings/agent_configurations.spec.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; import url from 'url'; import { synthtrace } from '../../../../synthtrace'; diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/errors/generate_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/errors/generate_data.ts index 66a70428b2275..56978f03123a8 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/errors/generate_data.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/errors/generate_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; export function generateData({ from, to }: { from: number; to: number }) { const range = timerange(from, to); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/generate_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/generate_data.ts index 4fc94d2305b57..e3cdf7e8bbce8 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/generate_data.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/generate_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; export function generateMultipleServicesData({ from, diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/header_filters/generate_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/header_filters/generate_data.ts index 94b7ab52f6f70..243f1df257a4f 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/header_filters/generate_data.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/header_filters/generate_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; export function generateData({ from, diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/aws_lambda/generate_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/aws_lambda/generate_data.ts index 68dc3f62b5c12..bbd7553d1fa33 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/aws_lambda/generate_data.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/aws_lambda/generate_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; const dataConfig = { serviceName: 'synth-python', diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/transaction_details/generate_span_links_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/transaction_details/generate_span_links_data.ts index 3905cf324c44a..0ced34d8a1b7c 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/transaction_details/generate_span_links_data.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/transaction_details/generate_span_links_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, EntityArrayIterable, timerange } from '@elastic/apm-synthtrace'; +import { apm, EntityArrayIterable, timerange } from '@kbn/apm-synthtrace'; import { synthtrace } from '../../../../synthtrace'; import { SpanLink } from '../../../../../typings/es_schemas/raw/fields/span_links'; diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/plugins/index.ts b/x-pack/plugins/apm/ftr_e2e/cypress/plugins/index.ts index 25b29e080b2c2..54622cb59bd5e 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/plugins/index.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/plugins/index.ts @@ -9,7 +9,7 @@ import { createLogger, EntityArrayIterable, LogLevel, -} from '@elastic/apm-synthtrace'; +} from '@kbn/apm-synthtrace'; import { createEsClientForTesting } from '@kbn/test'; // *********************************************************** diff --git a/x-pack/plugins/apm/ftr_e2e/synthtrace.ts b/x-pack/plugins/apm/ftr_e2e/synthtrace.ts index de113c6c44c4d..6fb880c40b0cc 100644 --- a/x-pack/plugins/apm/ftr_e2e/synthtrace.ts +++ b/x-pack/plugins/apm/ftr_e2e/synthtrace.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { EntityIterable } from '@elastic/apm-synthtrace'; +import type { EntityIterable } from '@kbn/apm-synthtrace'; export const synthtrace = { index: (events: EntityIterable) => diff --git a/x-pack/plugins/apm/public/application/application.test.tsx b/x-pack/plugins/apm/public/application/application.test.tsx index 62adf0b2cb355..3c2d46ef3a107 100644 --- a/x-pack/plugins/apm/public/application/application.test.tsx +++ b/x-pack/plugins/apm/public/application/application.test.tsx @@ -122,7 +122,8 @@ describe('renderApp (APM)', () => { }; }; - it('renders the app', () => { + it('renders the app', async () => { + const promise = Promise.resolve(); const mountProps = getApmMountProps(); let unmount: () => void; @@ -131,6 +132,11 @@ describe('renderApp (APM)', () => { unmount = renderApmApp(mountProps); }); + // fake promise to wait for to ensure the app is mounted + await act(async () => { + await promise; + }); + expect(() => { unmount(); }).not.toThrowError(); 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 55b486f5ae366..ff8442016adc5 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 @@ -9,7 +9,7 @@ import { EuiPageHeaderProps } from '@elastic/eui'; import React from 'react'; import { useLocation } from 'react-router-dom'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template'; import { enableServiceGroups } from '@kbn/observability-plugin/public'; import { EnvironmentsContextProvider } from '../../../context/environments_context/environments_context'; import { useFetcher, FETCH_STATUS } from '../../../hooks/use_fetcher'; 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 7acf14fc0bf01..c6c4c405d11af 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 @@ -14,7 +14,6 @@ import { import { i18n } from '@kbn/i18n'; import { omit } from 'lodash'; import React from 'react'; -import { enableInfrastructureView } from '@kbn/observability-plugin/public'; import { isMobileAgentName, isJavaAgentName, @@ -177,8 +176,6 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { capabilities ); - const showInfraTab = core.uiSettings.get(enableInfrastructureView); - const router = useApmRouter(); const { @@ -269,8 +266,6 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { label: i18n.translate('xpack.apm.home.infraTabLabel', { defaultMessage: 'Infrastructure', }), - - hidden: !showInfraTab, }, { key: 'service-map', 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 index 4e4c90b4cfeac..9a36431b1f825 100644 --- 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 @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { NoDataConfig } from '@kbn/shared-ux-page-kibana-template'; export function getNoDataConfig({ docsLink, @@ -22,7 +22,7 @@ export function getNoDataConfig({ basePath?: string; hasApmData?: boolean; hasApmIntegrations?: boolean; -}): KibanaPageTemplateProps['noDataConfig'] { +}): NoDataConfig | undefined { // don't show "no data screen" when there is APM data or it should be bypassed if (hasApmData || shouldBypassNoDataScreen || loading) { return; diff --git a/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx b/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx index a891ab9bdcdce..1eece05eb8843 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx @@ -16,7 +16,7 @@ import { import React from 'react'; import { i18n } from '@kbn/i18n'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template'; import { enableServiceGroups } from '@kbn/observability-plugin/public'; import { useFetcher, FETCH_STATUS } from '../../../hooks/use_fetcher'; import { ApmPluginStartDeps } from '../../../plugin'; diff --git a/x-pack/plugins/apm/readme.md b/x-pack/plugins/apm/readme.md index df7b641fbb231..fb7cf20732bf3 100644 --- a/x-pack/plugins/apm/readme.md +++ b/x-pack/plugins/apm/readme.md @@ -13,7 +13,7 @@ ## Tooling - [VSCode setup instructions](./dev_docs/vscode_setup.md) - [Github PR commands](./dev_docs/github_commands.md) -- [Synthtrace (data generation)](https://github.com/elastic/kibana/blob/main/packages/elastic-apm-synthtrace/README.md) +- [Synthtrace (data generation)](https://github.com/elastic/kibana/blob/main/packages/kbn-apm-synthtrace/README.md) - [Query debugging in development and production](./dev_docs/query_debugging_in_development_and_production.md) ## Other resources diff --git a/x-pack/plugins/apm/scripts/aggregate_latency_metrics/index.ts b/x-pack/plugins/apm/scripts/aggregate_latency_metrics/index.ts index f9aa943b5eceb..a48da0f4577cc 100644 --- a/x-pack/plugins/apm/scripts/aggregate_latency_metrics/index.ts +++ b/x-pack/plugins/apm/scripts/aggregate_latency_metrics/index.ts @@ -8,7 +8,7 @@ import { argv } from 'yargs'; import pLimit from 'p-limit'; import pRetry from 'p-retry'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { uniq, without, merge, flatten } from 'lodash'; import * as histogram from 'hdr-histogram-js'; import { diff --git a/x-pack/plugins/canvas/public/components/asset_manager/asset.tsx b/x-pack/plugins/canvas/public/components/asset_manager/asset.tsx index 9150b78f6000a..256d33a8e7a78 100644 --- a/x-pack/plugins/canvas/public/components/asset_manager/asset.tsx +++ b/x-pack/plugins/canvas/public/components/asset_manager/asset.tsx @@ -7,7 +7,7 @@ import { Dispatch } from 'redux'; import { connect } from 'react-redux'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { fromExpression, toExpression } from '@kbn/interpreter'; diff --git a/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.component.tsx b/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.component.tsx index d7eafc93ff1a2..5301c00f1f82b 100644 --- a/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.component.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.component.tsx @@ -67,7 +67,6 @@ export const WorkpadApp: FC = ({ deselectElement, isWriteable, workpad })
{/* NOTE: canvasWorkpadContainer is used for exporting */}
({ - deselectElement: (ev) => { - ev.stopPropagation(); - dispatch(selectToplevelNodes([])); - }, -}); - -export const WorkpadApp = connect( - (state: State) => ({ - isWriteable: isWriteable(state) && canUserWrite(state), - workpad: getWorkpad(state), - }), - mapDispatchToProps -)(WorkpadAppComponent); +export const WorkpadApp = connect((state: State) => ({ + isWriteable: isWriteable(state) && canUserWrite(state), + workpad: getWorkpad(state), +}))(WorkpadAppComponent); diff --git a/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.component.tsx b/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.component.tsx index 0561ac005519b..c14e54d8e8549 100644 --- a/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.component.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.component.tsx @@ -5,8 +5,11 @@ * 2.0. */ -import React from 'react'; +import React, { useCallback } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; import { i18n } from '@kbn/i18n'; +import { addColor, removeColor } from '../../state/actions/workpad'; +import { getWorkpadColors } from '../../state/selectors/workpad'; import { ColorPickerPopover, Props } from '../color_picker_popover'; const strings = { @@ -17,9 +20,17 @@ const strings = { }; export const WorkpadColorPicker = (props: Props) => { + const dispatch = useDispatch(); + const onAddColor = useCallback((payload) => dispatch(addColor(payload)), [dispatch]); + const onRemoveColor = useCallback((payload) => dispatch(removeColor(payload)), [dispatch]); + const colors = useSelector(getWorkpadColors); + return ( diff --git a/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.ts b/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.ts index 140de2b73ddf0..fe029c88c8cf1 100644 --- a/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.ts +++ b/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.ts @@ -5,20 +5,4 @@ * 2.0. */ -import { connect } from 'react-redux'; -import { addColor, removeColor } from '../../state/actions/workpad'; -import { getWorkpadColors } from '../../state/selectors/workpad'; - -import { WorkpadColorPicker as Component } from './workpad_color_picker.component'; -import { State } from '../../../types'; - -const mapStateToProps = (state: State) => ({ - colors: getWorkpadColors(state), -}); - -const mapDispatchToProps = { - onAddColor: addColor, - onRemoveColor: removeColor, -}; - -export const WorkpadColorPicker = connect(mapStateToProps, mapDispatchToProps)(Component); +export { WorkpadColorPicker } from './workpad_color_picker.component'; diff --git a/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.component.tsx b/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.component.tsx index 7b1df158087b4..ce93c370aa0f6 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.component.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.component.tsx @@ -5,11 +5,15 @@ * 2.0. */ -import React, { MouseEventHandler } from 'react'; +import React, { useCallback } from 'react'; import PropTypes from 'prop-types'; import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { useDispatch, useSelector } from 'react-redux'; +// @ts-expect-error untyped local +import { fetchAllRenderables } from '../../../state/actions/elements'; +import { getInFlight } from '../../../state/selectors/resolved_args'; import { ToolTipShortcut } from '../../tool_tip_shortcut'; const strings = { @@ -23,30 +27,31 @@ const strings = { }), }; -export interface Props { - doRefresh: MouseEventHandler; - inFlight: boolean; -} +export const RefreshControl = () => { + const dispatch = useDispatch(); + const inFlight = useSelector(getInFlight); + const doRefresh = useCallback(() => dispatch(fetchAllRenderables()), [dispatch]); -export const RefreshControl = ({ doRefresh, inFlight }: Props) => ( - - {strings.getRefreshTooltip()} - - - } - > - - -); + return ( + + {strings.getRefreshTooltip()} + + + } + > + + + ); +}; RefreshControl.propTypes = { doRefresh: PropTypes.func.isRequired, diff --git a/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.ts b/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.ts index c9182eea7ff4d..ef620ee897dc3 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.ts +++ b/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.ts @@ -5,19 +5,4 @@ * 2.0. */ -import { connect } from 'react-redux'; -// @ts-expect-error untyped local -import { fetchAllRenderables } from '../../../state/actions/elements'; -import { getInFlight } from '../../../state/selectors/resolved_args'; -import { State } from '../../../../types'; -import { RefreshControl as Component } from './refresh_control.component'; - -const mapStateToProps = (state: State) => ({ - inFlight: getInFlight(state), -}); - -const mapDispatchToProps = { - doRefresh: fetchAllRenderables, -}; - -export const RefreshControl = connect(mapStateToProps, mapDispatchToProps)(Component); +export { RefreshControl } from './refresh_control.component'; diff --git a/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts index e8527089c9ac4..bb06444c0c8f6 100644 --- a/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts +++ b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts @@ -76,7 +76,6 @@ const setupHandler = (commit: CommitFn, canvasOrigin: CanvasOriginFn, zoomScale? return; } - e.stopPropagation(); const { x, y } = localMousePosition(canvasOrigin, clientX, clientY, zoomScale); commit('mouseEvent', { event: 'mouseUp', x, y, altKey, metaKey, shiftKey, ctrlKey }); resetHandler(); @@ -123,7 +122,6 @@ const handleMouseDown = ( return; } - e.stopPropagation(); if (buttons !== 1 || !commit) { resetHandler(); return; // left-click only diff --git a/x-pack/plugins/canvas/public/expression_types/arg_types/font.js b/x-pack/plugins/canvas/public/expression_types/arg_types/font.js index 1ec6ba77685ef..d1e71fb59bf4d 100644 --- a/x-pack/plugins/canvas/public/expression_types/arg_types/font.js +++ b/x-pack/plugins/canvas/public/expression_types/arg_types/font.js @@ -8,7 +8,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { get, mapValues } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { openSans } from '../../../common/lib/fonts'; import { templateFromReactComponent } from '../../lib/template_from_react_component'; import { TextStylePicker } from '../../components/text_style_picker'; diff --git a/x-pack/plugins/canvas/public/functions/plot/index.ts b/x-pack/plugins/canvas/public/functions/plot/index.ts index 5880d833c5be1..cc2a893777c2e 100644 --- a/x-pack/plugins/canvas/public/functions/plot/index.ts +++ b/x-pack/plugins/canvas/public/functions/plot/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { groupBy, get, keyBy, map, sortBy } from 'lodash'; import { ExpressionFunctionDefinition, Style } from '@kbn/expressions-plugin/common'; import type { PaletteRegistry, PaletteOutput } from '@kbn/coloring'; diff --git a/x-pack/plugins/canvas/shareable_runtime/api/index.ts b/x-pack/plugins/canvas/shareable_runtime/api/index.ts index ad9e4fcf03cdc..52e0f81f87e91 100644 --- a/x-pack/plugins/canvas/shareable_runtime/api/index.ts +++ b/x-pack/plugins/canvas/shareable_runtime/api/index.ts @@ -6,7 +6,7 @@ */ import 'core-js/stable'; -import 'regenerator-runtime/runtime'; +import '@babel/runtime/regenerator'; import 'whatwg-fetch'; import 'jquery'; import '@kbn/flot-charts'; diff --git a/x-pack/plugins/canvas/storybook/decorators/redux_decorator.tsx b/x-pack/plugins/canvas/storybook/decorators/redux_decorator.tsx index 22dd3fcbd711e..e3864086a85dd 100644 --- a/x-pack/plugins/canvas/storybook/decorators/redux_decorator.tsx +++ b/x-pack/plugins/canvas/storybook/decorators/redux_decorator.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { createStore } from 'redux'; import { Provider as ReduxProvider } from 'react-redux'; import { cloneDeep } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { CanvasWorkpad, CanvasElement, CanvasAsset, CanvasPage } from '../../types'; diff --git a/x-pack/plugins/cases/public/common/mock/test_providers.tsx b/x-pack/plugins/cases/public/common/mock/test_providers.tsx index 46dda67c23f7f..dceb8fd0f30a7 100644 --- a/x-pack/plugins/cases/public/common/mock/test_providers.tsx +++ b/x-pack/plugins/cases/public/common/mock/test_providers.tsx @@ -12,7 +12,7 @@ import { ThemeProvider } from 'styled-components'; import { render as reactRender, RenderOptions, RenderResult } from '@testing-library/react'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { SECURITY_SOLUTION_OWNER } from '../../../common/constants'; import { CasesCapabilities, CasesFeatures, CasesPermissions } from '../../../common/ui/types'; import { CasesProvider } from '../../components/cases_context'; diff --git a/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.test.tsx b/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.test.tsx index eba8888f3367a..98c89215aac21 100644 --- a/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.test.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.test.tsx @@ -12,7 +12,7 @@ import { AllCasesSelectorModal } from '.'; import { TestProviders } from '../../../common/mock'; import { AllCasesList } from '../all_cases_list'; -jest.mock('../all_cases_list'); +jest.mock('../all_cases_list', () => ({ AllCasesList: jest.fn().mockReturnValue(<>) })); const onRowClick = jest.fn(); const defaultProps = { @@ -57,8 +57,7 @@ describe('AllCasesSelectorModal', () => { ); - // @ts-ignore idk what this mock style is but it works ¯\_(ツ)_/¯ - expect(AllCasesList.type.mock.calls[0][0]).toEqual( + expect((AllCasesList as unknown as jest.Mock).mock.calls[0][0]).toEqual( expect.objectContaining({ hiddenStatuses: fullProps.hiddenStatuses, isSelectorView: true, diff --git a/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx b/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx index 173d4ec76b230..fccdf76abd2c4 100644 --- a/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx @@ -15,7 +15,7 @@ import { EuiModalHeaderTitle, } from '@elastic/eui'; import styled from 'styled-components'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import { Case, CaseStatusWithAllStatus } from '../../../../common/ui/types'; import * as i18n from '../../../common/translations'; import { AllCasesList } from '../all_cases_list'; diff --git a/x-pack/plugins/cases/public/components/app/routes.tsx b/x-pack/plugins/cases/public/components/app/routes.tsx index 6e952ce84ba1e..062007f3341e6 100644 --- a/x-pack/plugins/cases/public/components/app/routes.tsx +++ b/x-pack/plugins/cases/public/components/app/routes.tsx @@ -8,7 +8,7 @@ import React, { lazy, Suspense, useCallback } from 'react'; import { Redirect, Switch } from 'react-router-dom'; import { Route } from '@kbn/kibana-react-plugin/public'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import { EuiLoadingSpinner } from '@elastic/eui'; import { AllCases } from '../all_cases'; import { CreateCase } from '../create'; diff --git a/x-pack/plugins/cases/public/components/case_view/case_view_page.test.tsx b/x-pack/plugins/cases/public/components/case_view/case_view_page.test.tsx index ea9ce12828938..284785b33d720 100644 --- a/x-pack/plugins/cases/public/components/case_view/case_view_page.test.tsx +++ b/x-pack/plugins/cases/public/components/case_view/case_view_page.test.tsx @@ -40,7 +40,9 @@ jest.mock('../../containers/use_get_tags'); jest.mock('../../containers/use_get_case'); jest.mock('../../containers/configure/use_connectors'); jest.mock('../../containers/use_post_push_to_service'); -jest.mock('../user_actions/timestamp'); +jest.mock('../user_actions/timestamp', () => ({ + UserActionTimestamp: () => <>, +})); jest.mock('../../common/navigation/hooks'); jest.mock('../../common/hooks'); jest.mock('../connectors/resilient/api'); diff --git a/x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx b/x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx index 8a3a457bcfd00..db5411525290b 100644 --- a/x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx +++ b/x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx @@ -30,7 +30,9 @@ import { useGetTags } from '../../../containers/use_get_tags'; jest.mock('../../../containers/use_get_case_user_actions'); jest.mock('../../../containers/configure/use_connectors'); jest.mock('../../../containers/use_post_push_to_service'); -jest.mock('../../user_actions/timestamp'); +jest.mock('../../user_actions/timestamp', () => ({ + UserActionTimestamp: () => <>, +})); jest.mock('../../../common/navigation/hooks'); jest.mock('../../../containers/use_get_action_license'); jest.mock('../../../containers/use_get_tags'); diff --git a/x-pack/plugins/cases/public/components/case_view/index.test.tsx b/x-pack/plugins/cases/public/components/case_view/index.test.tsx index b9213a8eb887f..20cf2c8d0d9b4 100644 --- a/x-pack/plugins/cases/public/components/case_view/index.test.tsx +++ b/x-pack/plugins/cases/public/components/case_view/index.test.tsx @@ -49,7 +49,9 @@ jest.mock('../../containers/use_get_case'); jest.mock('../../containers/use_get_case_metrics'); jest.mock('../../containers/configure/use_connectors'); jest.mock('../../containers/use_post_push_to_service'); -jest.mock('../user_actions/timestamp'); +jest.mock('../user_actions/timestamp', () => ({ + UserActionTimestamp: () => <>, +})); jest.mock('../../common/lib/kibana'); jest.mock('../../common/navigation/hooks'); jest.mock('../../containers/api'); @@ -171,7 +173,7 @@ describe('CaseView', () => { const queryClientSpy = jest.spyOn(appMockRenderer.queryClient, 'invalidateQueries'); const result = appMockRenderer.render(); userEvent.click(result.getByTestId('case-refresh')); - expect(queryClientSpy).toHaveBeenCalledWith('case'); + expect(queryClientSpy).toHaveBeenCalledWith(['case']); }); describe('when a `refreshRef` prop is provided', () => { @@ -203,7 +205,7 @@ describe('CaseView', () => { it('should refresh actions and comments', async () => { refreshRef!.current!.refreshCase(); await waitFor(() => { - expect(queryClientSpy).toHaveBeenCalledWith(CASE_VIEW_CACHE_KEY); + expect(queryClientSpy).toHaveBeenCalledWith([CASE_VIEW_CACHE_KEY]); }); }); }); diff --git a/x-pack/plugins/cases/public/components/case_view/use_on_refresh_case_view_page.tsx b/x-pack/plugins/cases/public/components/case_view/use_on_refresh_case_view_page.tsx index a4c36deabef80..396f180a074a0 100644 --- a/x-pack/plugins/cases/public/components/case_view/use_on_refresh_case_view_page.tsx +++ b/x-pack/plugins/cases/public/components/case_view/use_on_refresh_case_view_page.tsx @@ -6,7 +6,7 @@ */ import { useCallback } from 'react'; -import { useQueryClient } from 'react-query'; +import { useQueryClient } from '@tanstack/react-query'; import { CASE_TAGS_CACHE_KEY, CASE_VIEW_CACHE_KEY } from '../../containers/constants'; /** @@ -20,7 +20,7 @@ import { CASE_TAGS_CACHE_KEY, CASE_VIEW_CACHE_KEY } from '../../containers/const export const useRefreshCaseViewPage = () => { const queryClient = useQueryClient(); return useCallback(() => { - queryClient.invalidateQueries(CASE_VIEW_CACHE_KEY); - queryClient.invalidateQueries(CASE_TAGS_CACHE_KEY); + queryClient.invalidateQueries([CASE_VIEW_CACHE_KEY]); + queryClient.invalidateQueries([CASE_TAGS_CACHE_KEY]); }, [queryClient]); }; diff --git a/x-pack/plugins/cases/public/components/cases_context/query_client.ts b/x-pack/plugins/cases/public/components/cases_context/query_client.ts index 08a135f5f9395..3f27e7b550adf 100644 --- a/x-pack/plugins/cases/public/components/cases_context/query_client.ts +++ b/x-pack/plugins/cases/public/components/cases_context/query_client.ts @@ -5,6 +5,6 @@ * 2.0. */ -import { QueryClient } from 'react-query'; +import { QueryClient } from '@tanstack/react-query'; export const casesQueryClient = new QueryClient(); diff --git a/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.tsx b/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.tsx index be758e1718451..c7bcb9b0828c6 100644 --- a/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.tsx +++ b/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.tsx @@ -9,7 +9,7 @@ import React from 'react'; import styled, { createGlobalStyle } from 'styled-components'; import { EuiFlyout, EuiFlyoutHeader, EuiTitle, EuiFlyoutBody } from '@elastic/eui'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import * as i18n from '../translations'; import { Case } from '../../../../common/ui/types'; import { CreateCaseForm } from '../form'; diff --git a/x-pack/plugins/cases/public/components/header_page/__snapshots__/editable_title.test.tsx.snap b/x-pack/plugins/cases/public/components/header_page/__snapshots__/editable_title.test.tsx.snap index bc4dba5843e62..73f466aeec771 100644 --- a/x-pack/plugins/cases/public/components/header_page/__snapshots__/editable_title.test.tsx.snap +++ b/x-pack/plugins/cases/public/components/header_page/__snapshots__/editable_title.test.tsx.snap @@ -14,11 +14,38 @@ exports[`EditableTitle renders 1`] = ` "retry": false, }, }, + "logger": BufferedConsole { + "Console": [Function], + "_buffer": Array [], + "_counters": Object {}, + "_groupDepth": 0, + "_timers": Object {}, + "assert": [Function], + "clear": [Function], + "count": [Function], + "countReset": [Function], + "debug": [Function], + "dir": [Function], + "dirxml": [Function], + "error": [Function], + "group": [Function], + "groupCollapsed": [Function], + "groupEnd": [Function], + "info": [Function], + "log": [Function], + "table": [Function], + "time": [Function], + "timeEnd": [Function], + "timeLog": [Function], + "trace": [Function], + "warn": [Function], + }, "mutationCache": MutationCache { "config": Object {}, "listeners": Array [], "mutationId": 0, "mutations": Array [], + "subscribe": [Function], }, "mutationDefaults": Array [], "queryCache": QueryCache { @@ -26,6 +53,7 @@ exports[`EditableTitle renders 1`] = ` "listeners": Array [], "queries": Array [], "queriesMap": Object {}, + "subscribe": [Function], }, "queryDefaults": Array [], } diff --git a/x-pack/plugins/cases/public/components/header_page/__snapshots__/index.test.tsx.snap b/x-pack/plugins/cases/public/components/header_page/__snapshots__/index.test.tsx.snap index 083975a40330e..7e6d9e2b05d94 100644 --- a/x-pack/plugins/cases/public/components/header_page/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/cases/public/components/header_page/__snapshots__/index.test.tsx.snap @@ -14,11 +14,38 @@ exports[`HeaderPage it renders 1`] = ` "retry": false, }, }, + "logger": BufferedConsole { + "Console": [Function], + "_buffer": Array [], + "_counters": Object {}, + "_groupDepth": 0, + "_timers": Object {}, + "assert": [Function], + "clear": [Function], + "count": [Function], + "countReset": [Function], + "debug": [Function], + "dir": [Function], + "dirxml": [Function], + "error": [Function], + "group": [Function], + "groupCollapsed": [Function], + "groupEnd": [Function], + "info": [Function], + "log": [Function], + "table": [Function], + "time": [Function], + "timeEnd": [Function], + "timeLog": [Function], + "trace": [Function], + "warn": [Function], + }, "mutationCache": MutationCache { "config": Object {}, "listeners": Array [], "mutationId": 0, "mutations": Array [], + "subscribe": [Function], }, "mutationDefaults": Array [], "queryCache": QueryCache { @@ -26,6 +53,7 @@ exports[`HeaderPage it renders 1`] = ` "listeners": Array [], "queries": Array [], "queriesMap": Object {}, + "subscribe": [Function], }, "queryDefaults": Array [], } diff --git a/x-pack/plugins/cases/public/components/recent_cases/index.tsx b/x-pack/plugins/cases/public/components/recent_cases/index.tsx index 4cc070e77b76a..c8b7581e53107 100644 --- a/x-pack/plugins/cases/public/components/recent_cases/index.tsx +++ b/x-pack/plugins/cases/public/components/recent_cases/index.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiText, EuiTitle } from '@elastic/eui'; import React, { useCallback, useMemo, useState } from 'react'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import * as i18n from './translations'; import { LinkAnchor } from '../links'; import { RecentCasesFilters } from './filters'; diff --git a/x-pack/plugins/cases/public/components/user_actions/index.test.tsx b/x-pack/plugins/cases/public/components/user_actions/index.test.tsx index 9a971552f5ec3..60fc0e92d024b 100644 --- a/x-pack/plugins/cases/public/components/user_actions/index.test.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/index.test.tsx @@ -53,7 +53,9 @@ const defaultProps = { }; jest.mock('../../containers/use_update_comment'); -jest.mock('./timestamp'); +jest.mock('./timestamp', () => ({ + UserActionTimestamp: () => <>, +})); jest.mock('../../common/lib/kibana'); const useUpdateCommentMock = useUpdateComment as jest.Mock; diff --git a/x-pack/plugins/cases/public/containers/configure/use_action_types.tsx b/x-pack/plugins/cases/public/containers/configure/use_action_types.tsx index caca1de7afcec..76a48e5d09ca3 100644 --- a/x-pack/plugins/cases/public/containers/configure/use_action_types.tsx +++ b/x-pack/plugins/cases/public/containers/configure/use_action_types.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import * as i18n from '../translations'; import { fetchActionTypes } from './api'; import { useToasts } from '../../common/lib/kibana'; diff --git a/x-pack/plugins/cases/public/containers/configure/use_connectors.tsx b/x-pack/plugins/cases/public/containers/configure/use_connectors.tsx index 9f1d3f38655ae..95124af988fb6 100644 --- a/x-pack/plugins/cases/public/containers/configure/use_connectors.tsx +++ b/x-pack/plugins/cases/public/containers/configure/use_connectors.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { fetchConnectors } from './api'; import { useApplicationCapabilities, useToasts } from '../../common/lib/kibana'; import * as i18n from './translations'; diff --git a/x-pack/plugins/cases/public/containers/use_get_action_license.tsx b/x-pack/plugins/cases/public/containers/use_get_action_license.tsx index a64a449783ba9..8e9aa28de440a 100644 --- a/x-pack/plugins/cases/public/containers/use_get_action_license.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_action_license.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useToasts } from '../common/lib/kibana'; import { getActionLicense } from './api'; import * as i18n from './translations'; diff --git a/x-pack/plugins/cases/public/containers/use_get_case.test.tsx b/x-pack/plugins/cases/public/containers/use_get_case.test.tsx index 8a3d7263b78de..7b07d44bdda78 100644 --- a/x-pack/plugins/cases/public/containers/use_get_case.test.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_case.test.tsx @@ -10,7 +10,7 @@ import { useGetCase } from './use_get_case'; import * as api from './api'; import { waitFor } from '@testing-library/dom'; import React from 'react'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { useToasts } from '../common/lib/kibana'; jest.mock('./api'); diff --git a/x-pack/plugins/cases/public/containers/use_get_case.tsx b/x-pack/plugins/cases/public/containers/use_get_case.tsx index ff0cce344b87f..ded91240239a1 100644 --- a/x-pack/plugins/cases/public/containers/use_get_case.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_case.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { ResolvedCase } from './types'; import * as i18n from './translations'; import { useToasts } from '../common/lib/kibana'; diff --git a/x-pack/plugins/cases/public/containers/use_get_case_metrics.test.tsx b/x-pack/plugins/cases/public/containers/use_get_case_metrics.test.tsx index 3cd3904a24072..7f61397728170 100644 --- a/x-pack/plugins/cases/public/containers/use_get_case_metrics.test.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_case_metrics.test.tsx @@ -48,13 +48,11 @@ describe('useGetCaseMetrics', () => { throw new Error('Something went wrong'); }); - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useGetCaseMetrics(basicCase.id, features), { - wrapper, - }); - await waitForNextUpdate(); - expect(spyOnGetCaseMetrics).toBeCalledWith(basicCase.id, features, abortCtrl.signal); - expect(addError).toHaveBeenCalled(); + const { waitForNextUpdate } = renderHook(() => useGetCaseMetrics(basicCase.id, features), { + wrapper, }); + await waitForNextUpdate(); + expect(spyOnGetCaseMetrics).toBeCalledWith(basicCase.id, features, abortCtrl.signal); + expect(addError).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/cases/public/containers/use_get_case_metrics.tsx b/x-pack/plugins/cases/public/containers/use_get_case_metrics.tsx index 359bd6b7eeae9..1e294c4a5ba6e 100644 --- a/x-pack/plugins/cases/public/containers/use_get_case_metrics.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_case_metrics.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { SingleCaseMetrics, SingleCaseMetricsFeature } from './types'; import { useToasts } from '../common/lib/kibana'; import { getSingleCaseMetrics } from './api'; diff --git a/x-pack/plugins/cases/public/containers/use_get_case_user_actions.test.tsx b/x-pack/plugins/cases/public/containers/use_get_case_user_actions.test.tsx index 3d231a9660ba2..c5dbf017da8c9 100644 --- a/x-pack/plugins/cases/public/containers/use_get_case_user_actions.test.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_case_user_actions.test.tsx @@ -22,7 +22,7 @@ import { } from './mock'; import { Actions } from '../../common/api'; import React from 'react'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import { testQueryClient } from '../common/mock'; import { waitFor } from '@testing-library/dom'; import * as api from './api'; diff --git a/x-pack/plugins/cases/public/containers/use_get_case_user_actions.tsx b/x-pack/plugins/cases/public/containers/use_get_case_user_actions.tsx index 9376598b1fdf4..da695201d6d76 100644 --- a/x-pack/plugins/cases/public/containers/use_get_case_user_actions.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_case_user_actions.tsx @@ -8,7 +8,7 @@ import { isEmpty, uniqBy } from 'lodash/fp'; import deepEqual from 'fast-deep-equal'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { CaseUserActions, CaseExternalService } from '../../common/ui/types'; import { ActionTypes, CaseConnector, NONE_CONNECTOR_ID } from '../../common/api'; import { getCaseUserActions } from './api'; diff --git a/x-pack/plugins/cases/public/containers/use_get_cases.tsx b/x-pack/plugins/cases/public/containers/use_get_cases.tsx index 6274ac863200f..ce19e68fa1798 100644 --- a/x-pack/plugins/cases/public/containers/use_get_cases.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_cases.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery, UseQueryResult } from 'react-query'; +import { useQuery, UseQueryResult } from '@tanstack/react-query'; import { CASE_LIST_CACHE_KEY, DEFAULT_TABLE_ACTIVE_PAGE, DEFAULT_TABLE_LIMIT } from './constants'; import { Cases, FilterOptions, QueryParams, SortFieldCase, StatusAll, SeverityAll } from './types'; import { useToasts } from '../common/lib/kibana'; diff --git a/x-pack/plugins/cases/public/containers/use_get_tags.tsx b/x-pack/plugins/cases/public/containers/use_get_tags.tsx index 3e18ac0a01315..1696a9d1413a5 100644 --- a/x-pack/plugins/cases/public/containers/use_get_tags.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_tags.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useToasts } from '../common/lib/kibana'; import { useCasesContext } from '../components/cases_context/use_cases_context'; import { ServerError } from '../types'; diff --git a/x-pack/plugins/cases/public/containers/user_profiles/use_bulk_get_user_profiles.ts b/x-pack/plugins/cases/public/containers/user_profiles/use_bulk_get_user_profiles.ts index cdaee1848613c..78c310462f77e 100644 --- a/x-pack/plugins/cases/public/containers/user_profiles/use_bulk_get_user_profiles.ts +++ b/x-pack/plugins/cases/public/containers/user_profiles/use_bulk_get_user_profiles.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery, UseQueryResult } from 'react-query'; +import { useQuery, UseQueryResult } from '@tanstack/react-query'; import { UserProfile } from '@kbn/security-plugin/common'; import * as i18n from '../translations'; import { useKibana, useToasts } from '../../common/lib/kibana'; diff --git a/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.test.ts b/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.test.ts index 5ae16c8fa6e00..ef5fe32a23dff 100644 --- a/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.test.ts +++ b/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.test.ts @@ -26,21 +26,8 @@ describe('useSuggestUserProfiles', () => { let appMockRender: AppMockRenderer; - beforeAll(() => { - jest.useFakeTimers(); - }); - beforeEach(() => { appMockRender = createAppMockRenderer(); - jest.clearAllMocks(); - }); - - afterEach(() => { - jest.clearAllTimers(); - }); - - afterAll(() => { - jest.useRealTimers(); }); it('calls suggestUserProfiles with correct arguments', async () => { @@ -50,7 +37,6 @@ describe('useSuggestUserProfiles', () => { wrapper: appMockRender.AppWrapper, }); - jest.advanceTimersByTime(500); await waitFor(() => result.current.isSuccess); expect(spyOnSuggestUserProfiles).toBeCalledWith({ @@ -75,7 +61,6 @@ describe('useSuggestUserProfiles', () => { wrapper: appMockRender.AppWrapper, }); - jest.advanceTimersByTime(500); await waitFor(() => result.current.isError); expect(addError).toHaveBeenCalled(); diff --git a/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.ts b/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.ts index 3705224e1d0c8..6c83f853b2624 100644 --- a/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.ts +++ b/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.ts @@ -6,7 +6,7 @@ */ import { useState } from 'react'; -import { useQuery, UseQueryResult } from 'react-query'; +import { useQuery, UseQueryResult } from '@tanstack/react-query'; import useDebounce from 'react-use/lib/useDebounce'; import { UserProfile } from '@kbn/security-plugin/common'; import { DEFAULT_USER_SIZE } from '../../../common/constants'; diff --git a/x-pack/plugins/cases/server/services/so_reference_extractor.ts b/x-pack/plugins/cases/server/services/so_reference_extractor.ts index 622cce373e755..27fdf17b5f727 100644 --- a/x-pack/plugins/cases/server/services/so_reference_extractor.ts +++ b/x-pack/plugins/cases/server/services/so_reference_extractor.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import { SavedObject, SavedObjectReference, SavedObjectsUpdateResponse } from '@kbn/core/server'; diff --git a/x-pack/plugins/cloud_security_posture/public/application/csp_router.tsx b/x-pack/plugins/cloud_security_posture/public/application/csp_router.tsx index 2fd84c5967e29..9f17ae174dd67 100644 --- a/x-pack/plugins/cloud_security_posture/public/application/csp_router.tsx +++ b/x-pack/plugins/cloud_security_posture/public/application/csp_router.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Redirect, Route, RouteComponentProps, type RouteProps, Switch } from 'react-router-dom'; import { CLOUD_SECURITY_POSTURE_BASE_PATH, type CspSecuritySolutionContext } from '..'; import { cloudPosturePages } from '../common/navigation/constants'; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx b/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx index 5660080cb0a43..26b885ad44344 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { epmRouteService, type GetInfoResponse, diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_compliance_dashboard_data_api.ts b/x-pack/plugins/cloud_security_posture/public/common/api/use_compliance_dashboard_data_api.ts index feb9cf50ad120..c1b108bb5f98a 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_compliance_dashboard_data_api.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_compliance_dashboard_data_api.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { type QueryObserverOptions, useQuery } from 'react-query'; +import { type QueryObserverOptions, useQuery } from '@tanstack/react-query'; import { useKibana } from '../hooks/use_kibana'; import { ComplianceDashboardData } from '../../../common/types'; import { STATS_ROUTE_PATH } from '../../../common/constants'; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_latest_findings_data_view.ts b/x-pack/plugins/cloud_security_posture/public/common/api/use_latest_findings_data_view.ts index 8f7a9c9b59d5e..e40a4c5a8e8c2 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_latest_findings_data_view.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_latest_findings_data_view.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import type { DataView } from '@kbn/data-plugin/common'; import { CSP_LATEST_FINDINGS_DATA_VIEW } from '../../../common/constants'; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts b/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts index fce0b9c2d7790..7c5d4eb8dc31b 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery, type UseQueryOptions } from 'react-query'; +import { useQuery, type UseQueryOptions } from '@tanstack/react-query'; import { useKibana } from '../hooks/use_kibana'; import { CspSetupStatus } from '../../../common/types'; import { STATUS_ROUTE_PATH } from '../../../common/constants'; diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx index 3de37af1d7a65..c3cec5ca27774 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx @@ -18,7 +18,7 @@ import { TestProvider } from '../test/test_provider'; import { coreMock } from '@kbn/core/public/mocks'; import { render, screen } from '@testing-library/react'; import React, { ComponentProps } from 'react'; -import { UseQueryResult } from 'react-query'; +import { UseQueryResult } from '@tanstack/react-query'; import { CloudPosturePage } from './cloud_posture_page'; import { NoDataPage } from '@kbn/kibana-react-plugin/public'; import { useCspSetupStatusApi } from '../common/api/use_setup_status_api'; diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx index dfa1c51f5226a..4ded9cb9060bb 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; import { i18n } from '@kbn/i18n'; -import type { UseQueryResult } from 'react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; import { EuiEmptyPrompt } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { NoDataPage } from '@kbn/kibana-react-plugin/public'; @@ -166,7 +166,7 @@ export const CloudPosturePage = ({ return defaultErrorRenderer(getSetupStatus.error); } - if (getSetupStatus.isLoading || getSetupStatus.isIdle) { + if (getSetupStatus.isLoading) { return defaultLoadingRenderer(); } @@ -182,7 +182,7 @@ export const CloudPosturePage = ({ return errorRender(query.error); } - if (query.isLoading || query.isIdle) { + if (query.isLoading) { return loadingRender(); } diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx index 12ba2e9db3885..af10c55f19ea9 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import Chance from 'chance'; import { render, screen } from '@testing-library/react'; -import type { UseQueryResult } from 'react-query/types/react/types'; +import type { UseQueryResult } from '@tanstack/react-query'; import { createCspBenchmarkIntegrationFixture } from '../../test/fixtures/csp_benchmark_integration'; import { createReactQueryResponse } from '../../test/fixtures/react_query'; import { TestProvider } from '../../test/test_provider'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts index 0315893ef4cc2..ccdc3650b2596 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { ListResult } from '@kbn/fleet-plugin/common'; import { BENCHMARKS_ROUTE_PATH } from '../../../common/constants'; import type { BenchmarksQueryParams } from '../../../common/schemas/benchmark'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/findings_es_pit_context.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/findings_es_pit_context.ts index 54105ad21495f..aa1d660229d75 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/findings_es_pit_context.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/findings_es_pit_context.ts @@ -6,7 +6,7 @@ */ import { createContext, type MutableRefObject } from 'react'; -import type { UseQueryResult } from 'react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; interface FindingsEsPitContextValue { setPitId(newPitId: string): void; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/use_findings_es_pit.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/use_findings_es_pit.ts index d7d7d6cbe3415..d8f2b22f501d4 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/use_findings_es_pit.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/use_findings_es_pit.ts @@ -6,7 +6,7 @@ */ import { useCallback, useRef, useState } from 'react'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { CSP_LATEST_FINDINGS_DATA_VIEW, ES_PIT_ROUTE_PATH } from '../../../../common/constants'; import { useKibana } from '../../../common/hooks/use_kibana'; import { FINDINGS_PIT_KEEP_ALIVE } from '../constants'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.test.tsx index 7cc01358b17d5..2ee05a2565adc 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; import Chance from 'chance'; -import type { UseQueryResult } from 'react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; import { of } from 'rxjs'; import { useLatestFindingsDataView } from '../../common/api/use_latest_findings_data_view'; import { Findings } from './findings'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx index baf4391eb2cc8..873b2c3c5cd76 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React from 'react'; -import type { UseQueryResult } from 'react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; import { Redirect, Switch, Route, useLocation } from 'react-router-dom'; import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; import { NoFindingsStates } from '../../components/no_findings_states'; @@ -28,7 +28,7 @@ export const Findings = () => { if (!hasFindings) return ; let queryForCloudPosturePage: UseQueryResult = dataViewQuery; - if (pitQuery.isError || pitQuery.isLoading || pitQuery.isIdle) { + if (pitQuery.isError || pitQuery.isLoading) { queryForCloudPosturePage = pitQuery; } diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/latest_findings_container.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/latest_findings_container.test.tsx index 9dc42b2e4413c..4090f80435b46 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/latest_findings_container.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/latest_findings_container.test.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { UseQueryResult } from 'react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; import { createReactQueryResponse } from '../../../test/fixtures/react_query'; import React from 'react'; import { render } from '@testing-library/react'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/use_latest_findings.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/use_latest_findings.ts index 2766ddbebb047..720d21cea2012 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/use_latest_findings.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/use_latest_findings.ts @@ -5,7 +5,7 @@ * 2.0. */ import { useContext } from 'react'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { number } from 'io-ts'; import { lastValueFrom } from 'rxjs'; import type { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/resource_findings/use_resource_findings.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/resource_findings/use_resource_findings.ts index 44be336f1c041..53748c54eae0a 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/resource_findings/use_resource_findings.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/resource_findings/use_resource_findings.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { lastValueFrom } from 'rxjs'; import { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/use_findings_by_resource.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/use_findings_by_resource.ts index ebb8f56c84e40..6def567d64ddd 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/use_findings_by_resource.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/use_findings_by_resource.ts @@ -5,7 +5,7 @@ * 2.0. */ import { useContext } from 'react'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { lastValueFrom } from 'rxjs'; import { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx index 32fb45c9fe025..82238c2d7c4d0 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import Chance from 'chance'; import { Rules } from '.'; import { render, screen } from '@testing-library/react'; -import { QueryClient } from 'react-query'; +import { QueryClient } from '@tanstack/react-query'; import { TestProvider } from '../../test/test_provider'; import { useCspIntegrationInfo } from './use_csp_integration'; import { type RouteComponentProps } from 'react-router-dom'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx index 64488f27d1353..bd22be3fab482 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { RulesContainer } from './rules_container'; import { render, screen, fireEvent, within } from '@testing-library/react'; -import { QueryClient } from 'react-query'; +import { QueryClient } from '@tanstack/react-query'; import { useFindCspRules, useBulkUpdateCspRules, type RuleSavedObject } from './use_csp_rules'; import * as TEST_SUBJECTS from './test_subjects'; import { Chance } from 'chance'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_integration.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_integration.tsx index d28f63769a615..3743127e9b9bd 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_integration.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_integration.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { type CopyAgentPolicyResponse, type GetOnePackagePolicyResponse, diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules.ts b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules.ts index 8e9b74429b4a3..01ca13870964b 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useQuery, useMutation, useQueryClient } from 'react-query'; +import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { FunctionKeys } from 'utility-types'; import type { SavedObjectsFindOptions, SimpleSavedObject } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; @@ -74,10 +74,7 @@ export const useBulkUpdateCspRules = () => { }, onSettled: () => // Invalidate all queries for simplicity - queryClient.invalidateQueries({ - queryKey: CSP_RULE_SAVED_OBJECT_TYPE, - exact: false, - }), + queryClient.invalidateQueries([CSP_RULE_SAVED_OBJECT_TYPE]), } ); }; diff --git a/x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts b/x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts index 0169c359b26eb..9605515618882 100644 --- a/x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts +++ b/x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts @@ -5,10 +5,10 @@ * 2.0. */ -import type { UseQueryResult } from 'react-query/types/react/types'; +import type { UseQueryResult } from '@tanstack/react-query'; interface CreateReactQueryResponseInput { - status?: UseQueryResult['status']; + status?: UseQueryResult['status'] | 'idle'; data?: TData; error?: TError; } @@ -35,12 +35,12 @@ export const createReactQueryResponse = ({ if (status === 'idle') { return { - status, + status: 'loading', data: undefined, isSuccess: false, - isLoading: false, + isLoading: true, isError: false, - isIdle: true, + fetchStatus: 'idle', }; } diff --git a/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx b/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx index 758cdb8ca3f60..09c03c29750a7 100755 --- a/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx +++ b/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx @@ -9,7 +9,7 @@ import type { AppMountParameters, CoreStart } from '@kbn/core/public'; import React, { useMemo } from 'react'; import { I18nProvider } from '@kbn/i18n-react'; import { Router, Switch, Route } from 'react-router-dom'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { coreMock } from '@kbn/core/public/mocks'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts b/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts index 463bdab0cdb6e..6c6358e772e6a 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts @@ -24,8 +24,8 @@ import { createCspRuleSearchFilterByPackagePolicy } from '../../../common/utils/ import type { CspRule, CspRulesConfiguration } from '../../../common/schemas'; import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME, - UPDATE_RULES_CONFIG_ROUTE_PATH, CSP_RULE_SAVED_OBJECT_TYPE, + UPDATE_RULES_CONFIG_ROUTE_PATH, } from '../../../common/constants'; import { CspRouter } from '../../types'; @@ -38,7 +38,7 @@ export const getPackagePolicy = async ( // PackagePolicies always contains one element, even when package does not exist if (!packagePolicies || !packagePolicies[0].version) { - throw new Error(`package policy Id '${packagePolicyId}' is not exist`); + throw new Error(`Package policy Id '${packagePolicyId}' does not exist`); } if (packagePolicies[0].package?.name !== CLOUD_SECURITY_POSTURE_PACKAGE_NAME) { throw new Error( diff --git a/x-pack/plugins/enterprise_search/common/types/analytics.ts b/x-pack/plugins/enterprise_search/common/types/analytics.ts new file mode 100644 index 0000000000000..e75617645a139 --- /dev/null +++ b/x-pack/plugins/enterprise_search/common/types/analytics.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 interface AnalyticsCollection { + id: string; + name: string; + event_retention_day_length: number; +} + +export type AnalyticsCollectionDocument = Omit; diff --git a/x-pack/plugins/enterprise_search/common/types/error_codes.ts b/x-pack/plugins/enterprise_search/common/types/error_codes.ts index 327d000003f9b..46a787ae257ec 100644 --- a/x-pack/plugins/enterprise_search/common/types/error_codes.ts +++ b/x-pack/plugins/enterprise_search/common/types/error_codes.ts @@ -6,6 +6,7 @@ */ export enum ErrorCode { + ANALYTICS_COLLECTION_ALREADY_EXISTS = 'analytics_collection_already_exists', CONNECTOR_DOCUMENT_ALREADY_EXISTS = 'connector_document_already_exists', CRAWLER_ALREADY_EXISTS = 'crawler_already_exists', INDEX_ALREADY_EXISTS = 'index_already_exists', diff --git a/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/kibana_logic.mock.ts b/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/kibana_logic.mock.ts index e65f0a542ada5..0a4524ef06d71 100644 --- a/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/kibana_logic.mock.ts +++ b/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/kibana_logic.mock.ts @@ -20,6 +20,10 @@ export const mockKibanaValues = { }, history: mockHistory, navigateToUrl: jest.fn(), + productAccess: { + hasAppSearchAccess: true, + hasWorkplaceSearchAccess: true, + }, security: securityMock.createStart(), setBreadcrumbs: jest.fn(), setChromeIsVisible: jest.fn(), diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/client_libraries_popover/popover.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/client_libraries_popover/popover.tsx index b89f489952ab8..3ec4cab0a6ff6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/client_libraries_popover/popover.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/client_libraries_popover/popover.tsx @@ -14,10 +14,14 @@ import { EuiContextMenuPanel, EuiContextMenuItem, EuiText, + EuiIcon, + EuiFlexItem, + EuiFlexGroup, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { icons } from '../../../../../../assets/client_libraries'; import { docLinks } from '../../../../../shared/doc_links'; import { OverviewLogic } from '../../overview.logic'; @@ -25,6 +29,7 @@ import { OverviewLogic } from '../../overview.logic'; const libraries = [ { href: docLinks.clientsJavaIntroduction, + icon: icons.java, key: 'java', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.java', @@ -33,6 +38,7 @@ const libraries = [ }, { href: docLinks.clientsJsIntro, + icon: icons.javascript, key: 'javascript', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.javascript', @@ -41,6 +47,7 @@ const libraries = [ }, { href: docLinks.clientsRubyOverview, + icon: icons.ruby, key: 'ruby', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.ruby', @@ -49,6 +56,7 @@ const libraries = [ }, { href: docLinks.clientsGoIndex, + icon: icons.go, key: 'go', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.go', @@ -57,6 +65,7 @@ const libraries = [ }, { href: docLinks.clientsNetIntroduction, + icon: icons.dotnet, key: 'dotnet', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.dotnet', @@ -65,6 +74,7 @@ const libraries = [ }, { href: docLinks.clientsPhpGuide, + icon: icons.php, key: 'php', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.php', @@ -73,6 +83,7 @@ const libraries = [ }, { href: docLinks.clientsPerlGuide, + icon: icons.perl, key: 'perl', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.perl', @@ -81,6 +92,7 @@ const libraries = [ }, { href: docLinks.clientsPythonOverview, + icon: icons.python, key: 'python', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.python', @@ -89,6 +101,7 @@ const libraries = [ }, { href: docLinks.clientsRustOverview, + icon: icons.rust, key: 'rust', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.rust', @@ -116,15 +129,25 @@ export const ClientLibrariesPopover: React.FC = () => { > { - return ( - - -

{item.text}

-
-
- ); - })} + items={libraries.map((item) => ( + : undefined} + > + + + +

{item.text}

+
+
+ + + +
+
+ ))} /> ); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.test.ts index 5aecc732e8f00..36157301d3bae 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.test.ts @@ -30,6 +30,7 @@ const DEFAULT_VALUES = { data: undefined, hasNoIndices: false, indices: [], + isFirstRequest: true, isLoading: true, meta: DEFAULT_META, status: Status.IDLE, @@ -92,6 +93,7 @@ describe('IndicesLogic', () => { }, hasNoIndices: false, indices: elasticsearchViewIndices, + isFirstRequest: false, isLoading: false, meta: newMeta, status: Status.SUCCESS, @@ -122,6 +124,7 @@ describe('IndicesLogic', () => { }, hasNoIndices: true, indices: [], + isFirstRequest: false, isLoading: false, meta, status: Status.SUCCESS, @@ -150,6 +153,7 @@ describe('IndicesLogic', () => { }, hasNoIndices: false, indices: [], + isFirstRequest: false, isLoading: false, meta, status: Status.SUCCESS, @@ -229,6 +233,7 @@ describe('IndicesLogic', () => { }, hasNoIndices: false, indices: elasticsearchViewIndices, + isFirstRequest: false, isLoading: false, meta: DEFAULT_META, status: Status.SUCCESS, @@ -280,6 +285,7 @@ describe('IndicesLogic', () => { ingestionStatus: IngestionStatus.ERROR, }, ], + isFirstRequest: false, isLoading: false, meta: DEFAULT_META, status: Status.SUCCESS, @@ -320,6 +326,7 @@ describe('IndicesLogic', () => { ingestionStatus: IngestionStatus.CONNECTED, }, ], + isFirstRequest: false, isLoading: false, meta: DEFAULT_META, status: Status.SUCCESS, @@ -357,6 +364,7 @@ describe('IndicesLogic', () => { ingestionStatus: IngestionStatus.ERROR, }, ], + isFirstRequest: false, isLoading: false, meta: DEFAULT_META, status: Status.SUCCESS, @@ -406,6 +414,7 @@ describe('IndicesLogic', () => { ingestionStatus: IngestionStatus.SYNC_ERROR, }, ], + isFirstRequest: false, isLoading: false, meta: DEFAULT_META, status: Status.SUCCESS, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.ts index afdbafc7fd38c..59640a948ddbc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.ts @@ -43,11 +43,13 @@ export interface IndicesActions { }): { meta: Meta; returnHiddenIndices: boolean; searchQuery?: string }; makeRequest: typeof FetchIndicesAPILogic.actions.makeRequest; onPaginate(newPageIndex: number): { newPageIndex: number }; + setIsFirstRequest(): boolean; } export interface IndicesValues { data: typeof FetchIndicesAPILogic.values.data; hasNoIndices: boolean; indices: ElasticsearchViewIndex[]; + isFirstRequest: boolean; isLoading: boolean; meta: Meta; status: typeof FetchIndicesAPILogic.values.status; @@ -61,6 +63,7 @@ export const IndicesLogic = kea>({ searchQuery, }), onPaginate: (newPageIndex) => ({ newPageIndex }), + setIsFirstRequest: () => true, }, connect: { actions: [FetchIndicesAPILogic, ['makeRequest', 'apiSuccess', 'apiError']], @@ -76,6 +79,14 @@ export const IndicesLogic = kea>({ }), path: ['enterprise_search', 'content', 'indices_logic'], reducers: () => ({ + isFirstRequest: [ + true, + { + apiError: () => false, + apiSuccess: () => false, + setIsFirstRequest: () => true, + }, + ], meta: [ DEFAULT_META, { @@ -96,8 +107,8 @@ export const IndicesLogic = kea>({ (data) => (data?.indices ? data.indices.map(indexToViewIndex) : []), ], isLoading: [ - () => [selectors.status], - (status) => [Status.LOADING, Status.IDLE].includes(status), + () => [selectors.status, selectors.isFirstRequest], + (status, isFirstRequest) => [Status.LOADING, Status.IDLE].includes(status) && isFirstRequest, ], }), }); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/search_indices.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/search_indices.test.tsx index 105d287260b57..8b20cbaadb9c0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/search_indices.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/search_indices.test.tsx @@ -33,6 +33,7 @@ const mockValues = { const mockActions = { fetchIndices: jest.fn(), onPaginate: jest.fn(), + setIsFirstRequest: jest.fn(), }; describe('SearchIndices', () => { @@ -55,6 +56,7 @@ describe('SearchIndices', () => { expect(wrapper.find(GettingStartedSteps)).toHaveLength(1); expect(wrapper.find(ElasticsearchResources)).toHaveLength(1); + expect(mockActions.setIsFirstRequest).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/search_indices.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/search_indices.tsx index b6b0f433f6d17..96019c8139c97 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/search_indices.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/search_indices.tsx @@ -49,7 +49,7 @@ export const baseBreadcrumbs = [ ]; export const SearchIndices: React.FC = () => { - const { fetchIndices, onPaginate } = useActions(IndicesLogic); + const { fetchIndices, onPaginate, setIsFirstRequest } = useActions(IndicesLogic); const { meta, indices, hasNoIndices, isLoading } = useValues(IndicesLogic); const [showHiddenIndices, setShowHiddenIndices] = useState(false); const [searchQuery, setSearchValue] = useState(''); @@ -58,18 +58,29 @@ export const SearchIndices: React.FC = () => { 'enterprise-search-indices-callout-dismissed', false ); + + useEffect(() => { + // We don't want to trigger loading for each search query change, so we need this + // flag to set if the call to backend is first request. + setIsFirstRequest(); + }, []); + useEffect(() => { - fetchIndices({ meta, returnHiddenIndices: showHiddenIndices, searchQuery }); + fetchIndices({ + meta, + returnHiddenIndices: showHiddenIndices, + searchQuery, + }); }, [searchQuery, meta.page.current, showHiddenIndices]); const pageTitle = isLoading ? '' - : indices.length !== 0 - ? i18n.translate('xpack.enterpriseSearch.content.searchIndices.searchIndices.pageTitle', { - defaultMessage: 'Elasticsearch indices', - }) - : i18n.translate('xpack.enterpriseSearch.content.searchIndices.searchIndices.emptyPageTitle', { + : hasNoIndices + ? i18n.translate('xpack.enterpriseSearch.content.searchIndices.searchIndices.emptyPageTitle', { defaultMessage: 'Welcome to Enterprise Search', + }) + : i18n.translate('xpack.enterpriseSearch.content.searchIndices.searchIndices.pageTitle', { + defaultMessage: 'Elasticsearch indices', }); return ( diff --git a/x-pack/plugins/enterprise_search/public/applications/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/index.test.tsx index c8722adfebbd2..455707779e739 100644 --- a/x-pack/plugins/enterprise_search/public/applications/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/index.test.tsx @@ -7,6 +7,7 @@ import React from 'react'; +import { act } from '@testing-library/react'; import { getContext } from 'kea'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; @@ -47,7 +48,7 @@ describe('renderApp', () => { const unmount = renderApp(MockApp, kibanaDeps, pluginData); expect(mockContainer.querySelector('.hello-world')).not.toBeNull(); - unmount(); + act(() => unmount()); expect(mockContainer.innerHTML).toEqual(''); }); @@ -60,20 +61,30 @@ describe('renderApp', () => { }; describe('Enterprise Search apps', () => { - afterEach(() => unmount()); + afterEach(() => { + act(() => { + unmount(); + }); + }); it('renders EnterpriseSearchOverview', () => { - mount(EnterpriseSearchOverview); + act(() => { + mount(EnterpriseSearchOverview); + }); expect(mockContainer.querySelector('.kbnPageTemplate')).not.toBeNull(); }); it('renders AppSearch', () => { - mount(AppSearch); + act(() => { + mount(AppSearch); + }); expect(mockContainer.querySelector('.setupGuide')).not.toBeNull(); }); it('renders WorkplaceSearch', () => { - mount(WorkplaceSearch); + act(() => { + mount(WorkplaceSearch); + }); expect(mockContainer.querySelector('.setupGuide')).not.toBeNull(); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/index.tsx b/x-pack/plugins/enterprise_search/public/applications/index.tsx index 45179f6b55deb..5af50fce587fe 100644 --- a/x-pack/plugins/enterprise_search/public/applications/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/index.tsx @@ -18,7 +18,7 @@ import { I18nProvider } from '@kbn/i18n-react'; import { KibanaContextProvider, KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; -import { InitialAppData } from '../../common/types'; +import { InitialAppData, ProductAccess } from '../../common/types'; import { PluginsStart, ClientConfigType, ClientData } from '../plugin'; import { externalUrl } from './shared/enterprise_search_url'; @@ -41,6 +41,12 @@ export const renderApp = ( const { publicUrl, errorConnectingMessage, ...initialData } = data; externalUrl.enterpriseSearchUrl = publicUrl || config.host || ''; + const noProductAccess: ProductAccess = { + hasAppSearchAccess: false, + hasWorkplaceSearchAccess: false, + }; + const productAccess = data.access || noProductAccess; + const EmptyContext: FC = ({ children }) => <>{children}; const CloudContext = plugins.cloud?.CloudContextProvider || EmptyContext; @@ -49,6 +55,7 @@ export const renderApp = ( const unmountKibanaLogic = mountKibanaLogic({ config, + productAccess, charts: plugins.charts, cloud: plugins.cloud, history: params.history, diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts b/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts index 07aa3974b6479..d579cf17e5be9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts @@ -14,6 +14,8 @@ import { CloudSetup } from '@kbn/cloud-plugin/public'; import { ApplicationStart, ChromeBreadcrumb, ScopedHistory } from '@kbn/core/public'; import { SecurityPluginStart } from '@kbn/security-plugin/public'; +import { ProductAccess } from '../../../../common/types'; + import { HttpLogic } from '../http'; import { createHref, CreateHrefOptions } from '../react_router_helpers'; @@ -22,6 +24,7 @@ type RequiredFieldsOnly = { }; interface KibanaLogicProps { config: { host?: string }; + productAccess: ProductAccess; // Kibana core history: ScopedHistory; navigateToUrl: RequiredFieldsOnly; @@ -55,6 +58,7 @@ export const KibanaLogic = kea>({ }, {}, ], + productAccess: [props.productAccess, {}], security: [props.security, {}], setBreadcrumbs: [props.setBreadcrumbs, {}], setChromeIsVisible: [props.setChromeIsVisible, {}], diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx index a7a59916e7d09..ccc9c93c97951 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx @@ -9,10 +9,24 @@ jest.mock('./nav_link_helpers', () => ({ generateNavLink: jest.fn(({ to, items }) => ({ href: to, items })), })); +import { setMockValues } from '../../__mocks__/kea_logic'; + +import { ProductAccess } from '../../../../common/types'; + import { useEnterpriseSearchNav } from './nav'; describe('useEnterpriseSearchContentNav', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + it('returns an array of top-level Enterprise Search nav items', () => { + const fullProductAccess: ProductAccess = { + hasAppSearchAccess: true, + hasWorkplaceSearchAccess: true, + }; + setMockValues({ productAccess: fullProductAccess }); + expect(useEnterpriseSearchNav()).toEqual([ { href: '/app/enterprise_search/overview', @@ -53,4 +67,77 @@ describe('useEnterpriseSearchContentNav', () => { }, ]); }); + + it('excludes legacy products when the user has no access to them', () => { + const noProductAccess: ProductAccess = { + hasAppSearchAccess: false, + hasWorkplaceSearchAccess: false, + }; + + setMockValues({ productAccess: noProductAccess }); + + expect(useEnterpriseSearchNav()[2]).toEqual({ + id: 'search', + items: [ + { + href: '/app/enterprise_search/elasticsearch', + id: 'elasticsearch', + name: 'Elasticsearch', + }, + ], + name: 'Search', + }); + }); + + it('excludes App Search when the user has no access to it', () => { + const workplaceSearchProductAccess: ProductAccess = { + hasAppSearchAccess: false, + hasWorkplaceSearchAccess: true, + }; + + setMockValues({ productAccess: workplaceSearchProductAccess }); + + expect(useEnterpriseSearchNav()[2]).toEqual({ + id: 'search', + items: [ + { + href: '/app/enterprise_search/elasticsearch', + id: 'elasticsearch', + name: 'Elasticsearch', + }, + { + href: '/app/enterprise_search/workplace_search', + id: 'workplace_search', + name: 'Workplace Search', + }, + ], + name: 'Search', + }); + }); + + it('excludes Workplace Search when the user has no access to it', () => { + const appSearchProductAccess: ProductAccess = { + hasAppSearchAccess: true, + hasWorkplaceSearchAccess: false, + }; + + setMockValues({ productAccess: appSearchProductAccess }); + + expect(useEnterpriseSearchNav()[2]).toEqual({ + id: 'search', + items: [ + { + href: '/app/enterprise_search/elasticsearch', + id: 'elasticsearch', + name: 'Elasticsearch', + }, + { + href: '/app/enterprise_search/app_search', + id: 'app_search', + name: 'App Search', + }, + ], + name: 'Search', + }); + }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.tsx index c1af5095126f9..3611fd0a17375 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.tsx @@ -5,6 +5,8 @@ * 2.0. */ +import { useValues } from 'kea'; + import { EuiSideNavItemType } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -16,10 +18,13 @@ import { WORKPLACE_SEARCH_PLUGIN, } from '../../../../common/constants'; import { SEARCH_INDICES_PATH } from '../../enterprise_search_content/routes'; +import { KibanaLogic } from '../kibana'; import { generateNavLink } from './nav_link_helpers'; export const useEnterpriseSearchNav = () => { + const { productAccess } = useValues(KibanaLogic); + const navItems: Array> = [ { id: 'es_overview', @@ -63,26 +68,34 @@ export const useEnterpriseSearchNav = () => { to: ELASTICSEARCH_PLUGIN.URL, }), }, - { - id: 'app_search', - name: i18n.translate('xpack.enterpriseSearch.nav.appSearchTitle', { - defaultMessage: 'App Search', - }), - ...generateNavLink({ - shouldNotCreateHref: true, - to: APP_SEARCH_PLUGIN.URL, - }), - }, - { - id: 'workplace_search', - name: i18n.translate('xpack.enterpriseSearch.nav.workplaceSearchTitle', { - defaultMessage: 'Workplace Search', - }), - ...generateNavLink({ - shouldNotCreateHref: true, - to: WORKPLACE_SEARCH_PLUGIN.URL, - }), - }, + ...(productAccess.hasAppSearchAccess + ? [ + { + id: 'app_search', + name: i18n.translate('xpack.enterpriseSearch.nav.appSearchTitle', { + defaultMessage: 'App Search', + }), + ...generateNavLink({ + shouldNotCreateHref: true, + to: APP_SEARCH_PLUGIN.URL, + }), + }, + ] + : []), + ...(productAccess.hasWorkplaceSearchAccess + ? [ + { + id: 'workplace_search', + name: i18n.translate('xpack.enterpriseSearch.nav.workplaceSearchTitle', { + defaultMessage: 'Workplace Search', + }), + ...generateNavLink({ + shouldNotCreateHref: true, + to: WORKPLACE_SEARCH_PLUGIN.URL, + }), + }, + ] + : []), ], name: i18n.translate('xpack.enterpriseSearch.nav.searchExperiencesTitle', { defaultMessage: 'Search', diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/dotnet.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/dotnet.svg new file mode 100644 index 0000000000000..30fa56d08bffc --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/dotnet.svg @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/go.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/go.svg new file mode 100644 index 0000000000000..5b5fd6e7698af --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/go.svg @@ -0,0 +1,4 @@ + + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/index.ts b/x-pack/plugins/enterprise_search/public/assets/client_libraries/index.ts new file mode 100644 index 0000000000000..0e0e774aa5bba --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/index.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import dotnet from './dotnet.svg'; +import go from './go.svg'; +import java from './java.svg'; +import javascript from './javascript.svg'; +import perl from './perl.svg'; +import php from './php.svg'; +import python from './python.svg'; +import ruby from './ruby.svg'; +import rust from './rust.svg'; + +export const icons = { + dotnet, + go, + java, + javascript, + perl, + php, + python, + ruby, + rust, +}; diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/java.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/java.svg new file mode 100644 index 0000000000000..dbe654cdd99cf --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/java.svg @@ -0,0 +1,3 @@ + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/javascript.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/javascript.svg new file mode 100644 index 0000000000000..cdb7bd1a03848 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/javascript.svg @@ -0,0 +1,4 @@ + + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/perl.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/perl.svg new file mode 100644 index 0000000000000..72a2d21cc297a --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/perl.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/php.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/php.svg new file mode 100644 index 0000000000000..b80e9a92c9d5f --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/php.svg @@ -0,0 +1,3 @@ + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/python.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/python.svg new file mode 100644 index 0000000000000..b2c778e6355c5 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/python.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/ruby.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/ruby.svg new file mode 100644 index 0000000000000..0af569f1ee7ae --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/ruby.svg @@ -0,0 +1,3 @@ + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/rust.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/rust.svg new file mode 100644 index 0000000000000..9cbccb35b2baf --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/rust.svg @@ -0,0 +1,3 @@ + + + diff --git a/x-pack/plugins/enterprise_search/server/index.ts b/x-pack/plugins/enterprise_search/server/index.ts index 41cd17181b68b..3c409c09ff642 100644 --- a/x-pack/plugins/enterprise_search/server/index.ts +++ b/x-pack/plugins/enterprise_search/server/index.ts @@ -42,3 +42,5 @@ export const CONNECTORS_INDEX = '.elastic-connectors'; export const CONNECTORS_JOBS_INDEX = '.elastic-connectors-sync-jobs'; export const CONNECTORS_VERSION = '1'; export const CRAWLERS_INDEX = '.ent-search-actastic-crawler2_configurations'; +export const ANALYTICS_COLLECTIONS_INDEX = '.elastic-analytics-collections'; +export const ANALYTICS_VERSION = '1'; diff --git a/x-pack/plugins/enterprise_search/server/lib/analytics/add_analytics_collection.test.ts b/x-pack/plugins/enterprise_search/server/lib/analytics/add_analytics_collection.test.ts new file mode 100644 index 0000000000000..7f8e8401a37d9 --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/analytics/add_analytics_collection.test.ts @@ -0,0 +1,108 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; + +import { ANALYTICS_COLLECTIONS_INDEX } from '../..'; +import { ErrorCode } from '../../../common/types/error_codes'; + +import { addAnalyticsCollection } from './add_analytics_collection'; +import { fetchAnalyticsCollectionByName } from './fetch_analytics_collection'; +import { setupAnalyticsCollectionIndex } from './setup_indices'; + +jest.mock('./fetch_analytics_collection', () => ({ fetchAnalyticsCollectionByName: jest.fn() })); +jest.mock('./setup_indices', () => ({ + setupAnalyticsCollectionIndex: jest.fn(), +})); + +describe('add analytics collection lib function', () => { + const mockClient = { + asCurrentUser: { + index: jest.fn(), + indices: { + create: jest.fn(), + exists: jest.fn(), + refresh: jest.fn(), + }, + }, + asInternalUser: {}, + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should add analytics collection', async () => { + mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); + mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); + + await expect( + addAnalyticsCollection(mockClient as unknown as IScopedClusterClient, { + name: 'example', + }) + ).resolves.toEqual({ event_retention_day_length: 180, id: 'fakeId', name: 'example' }); + + expect(mockClient.asCurrentUser.index).toHaveBeenCalledWith({ + document: { + event_retention_day_length: 180, + name: 'example', + }, + index: ANALYTICS_COLLECTIONS_INDEX, + }); + }); + + it('should reject if index already exists', async () => { + mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); + (fetchAnalyticsCollectionByName as jest.Mock).mockImplementation(() => true); + + await expect( + addAnalyticsCollection(mockClient as unknown as IScopedClusterClient, { + name: 'index_name', + }) + ).rejects.toEqual(new Error(ErrorCode.ANALYTICS_COLLECTION_ALREADY_EXISTS)); + expect(mockClient.asCurrentUser.index).not.toHaveBeenCalled(); + }); + + it('should create index if no analytics collection index exists', async () => { + mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); + + (fetchAnalyticsCollectionByName as jest.Mock).mockImplementation(() => undefined); + + mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); + + await expect( + addAnalyticsCollection(mockClient as unknown as IScopedClusterClient, { + name: 'example', + }) + ).resolves.toEqual({ event_retention_day_length: 180, id: 'fakeId', name: 'example' }); + + expect(mockClient.asCurrentUser.index).toHaveBeenCalledWith({ + document: { + event_retention_day_length: 180, + name: 'example', + }, + index: ANALYTICS_COLLECTIONS_INDEX, + }); + + expect(setupAnalyticsCollectionIndex).toHaveBeenCalledWith(mockClient.asCurrentUser); + }); + + it('should not create index if status code is not 404', async () => { + mockClient.asCurrentUser.index.mockImplementationOnce(() => { + return Promise.reject({ statusCode: 500 }); + }); + mockClient.asCurrentUser.indices.exists.mockImplementation(() => true); + (fetchAnalyticsCollectionByName as jest.Mock).mockImplementation(() => false); + await expect( + addAnalyticsCollection(mockClient as unknown as IScopedClusterClient, { + name: 'example', + }) + ).rejects.toEqual({ statusCode: 500 }); + expect(setupAnalyticsCollectionIndex).not.toHaveBeenCalled(); + expect(mockClient.asCurrentUser.index).toHaveBeenCalledTimes(1); + }); +}); diff --git a/x-pack/plugins/enterprise_search/server/lib/analytics/add_analytics_collection.ts b/x-pack/plugins/enterprise_search/server/lib/analytics/add_analytics_collection.ts new file mode 100644 index 0000000000000..1cad55a3e884c --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/analytics/add_analytics_collection.ts @@ -0,0 +1,59 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { IScopedClusterClient } from '@kbn/core/server'; + +import { ANALYTICS_COLLECTIONS_INDEX } from '../..'; +import { AnalyticsCollectionDocument, AnalyticsCollection } from '../../../common/types/analytics'; + +import { ErrorCode } from '../../../common/types/error_codes'; + +import { fetchAnalyticsCollectionByName } from './fetch_analytics_collection'; +import { setupAnalyticsCollectionIndex } from './setup_indices'; + +const createAnalyticsCollection = async ( + client: IScopedClusterClient, + document: AnalyticsCollectionDocument +): Promise => { + const analyticsCollection = await fetchAnalyticsCollectionByName(client, document.name); + + if (analyticsCollection) { + throw new Error(ErrorCode.ANALYTICS_COLLECTION_ALREADY_EXISTS); + } + + // index the document + const result = await client.asCurrentUser.index({ + document, + index: ANALYTICS_COLLECTIONS_INDEX, + }); + + await client.asCurrentUser.indices.refresh({ index: ANALYTICS_COLLECTIONS_INDEX }); + + return { + id: result._id, + ...document, + }; +}; + +export const addAnalyticsCollection = async ( + client: IScopedClusterClient, + input: { name: string } +): Promise => { + const document: AnalyticsCollectionDocument = { + event_retention_day_length: 180, + name: input.name, + }; + + const analyticsCollectionIndexExists = await client.asCurrentUser.indices.exists({ + index: ANALYTICS_COLLECTIONS_INDEX, + }); + + if (!analyticsCollectionIndexExists) { + await setupAnalyticsCollectionIndex(client.asCurrentUser); + } + + return await createAnalyticsCollection(client, document); +}; diff --git a/x-pack/plugins/enterprise_search/server/lib/analytics/fetch_analytics_collection.test.ts b/x-pack/plugins/enterprise_search/server/lib/analytics/fetch_analytics_collection.test.ts new file mode 100644 index 0000000000000..e157df1df16f6 --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/analytics/fetch_analytics_collection.test.ts @@ -0,0 +1,103 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; + +import { ANALYTICS_COLLECTIONS_INDEX } from '../..'; + +import { fetchAnalyticsCollectionByName } from './fetch_analytics_collection'; +import { setupAnalyticsCollectionIndex } from './setup_indices'; + +jest.mock('./setup_indices', () => ({ + setupAnalyticsCollectionIndex: jest.fn(), +})); + +describe('fetch analytics collection lib function', () => { + const mockClient = { + asCurrentUser: { + search: jest.fn(), + }, + asInternalUser: {}, + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe('fetch collection by name', () => { + it('should fetch analytics collection by name', async () => { + mockClient.asCurrentUser.search.mockImplementationOnce(() => + Promise.resolve({ hits: { hits: [{ _id: 'fakeId', _source: { name: 'example' } }] } }) + ); + + await expect( + fetchAnalyticsCollectionByName(mockClient as unknown as IScopedClusterClient, 'example') + ).resolves.toEqual({ id: 'fakeId', name: 'example' }); + + expect(mockClient.asCurrentUser.search).toHaveBeenCalledWith({ + index: ANALYTICS_COLLECTIONS_INDEX, + query: { + term: { + name: 'example', + }, + }, + }); + }); + + it('should call setup analytics collection index on index not found error', async () => { + mockClient.asCurrentUser.search.mockImplementationOnce(() => + Promise.reject({ + meta: { + body: { + error: { type: 'index_not_found_exception' }, + }, + }, + }) + ); + await expect( + fetchAnalyticsCollectionByName(mockClient as unknown as IScopedClusterClient, 'example') + ).resolves.toEqual(undefined); + expect(mockClient.asCurrentUser.search).toHaveBeenCalledWith({ + index: ANALYTICS_COLLECTIONS_INDEX, + query: { + term: { + name: 'example', + }, + }, + }); + expect(setupAnalyticsCollectionIndex as jest.Mock).toHaveBeenCalledWith( + mockClient.asCurrentUser + ); + }); + + it('should not call setup connectors on other errors', async () => { + mockClient.asCurrentUser.search.mockImplementationOnce(() => + Promise.reject({ + meta: { + body: { + error: { + type: 'other error', + }, + }, + }, + }) + ); + await expect(fetchAnalyticsCollectionByName(mockClient as any, 'example')).resolves.toEqual( + undefined + ); + expect(mockClient.asCurrentUser.search).toHaveBeenCalledWith({ + index: ANALYTICS_COLLECTIONS_INDEX, + query: { + term: { + name: 'example', + }, + }, + }); + expect(setupAnalyticsCollectionIndex as jest.Mock).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/server/lib/analytics/fetch_analytics_collection.ts b/x-pack/plugins/enterprise_search/server/lib/analytics/fetch_analytics_collection.ts new file mode 100644 index 0000000000000..46f718d23976d --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/analytics/fetch_analytics_collection.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 { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; + +import { ANALYTICS_COLLECTIONS_INDEX } from '../..'; +import { AnalyticsCollection } from '../../../common/types/analytics'; + +import { isIndexNotFoundException } from '../../utils/identify_exceptions'; + +import { setupAnalyticsCollectionIndex } from './setup_indices'; + +export const fetchAnalyticsCollectionByName = async ( + client: IScopedClusterClient, + name: string +): Promise => { + try { + const searchResults = await client.asCurrentUser.search({ + index: ANALYTICS_COLLECTIONS_INDEX, + query: { term: { name } }, + }); + + const result = searchResults.hits.hits[0]?._source + ? { ...searchResults.hits.hits[0]._source, id: searchResults.hits.hits[0]._id } + : undefined; + + return result; + } catch (error) { + if (isIndexNotFoundException(error)) { + await setupAnalyticsCollectionIndex(client.asCurrentUser); + } + return undefined; + } +}; diff --git a/x-pack/plugins/enterprise_search/server/lib/analytics/setup_indices.test.ts b/x-pack/plugins/enterprise_search/server/lib/analytics/setup_indices.test.ts new file mode 100644 index 0000000000000..ec72d7562b44e --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/analytics/setup_indices.test.ts @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ANALYTICS_VERSION } from '../..'; + +import { setupAnalyticsCollectionIndex } from './setup_indices'; + +describe('setup analytics collection index', () => { + const mockClient = { + asCurrentUser: { + indices: { + create: jest.fn(), + updateAliases: jest.fn(), + }, + }, + asInternalUser: {}, + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it("should create the analytics collection index when it doesn't exist", async () => { + const indexName = '.elastic-analytics-collections'; + const analyticCollectionsMappings = { + _meta: { + version: ANALYTICS_VERSION, + }, + properties: { + event_retention_day_length: { + type: 'long', + }, + name: { + type: 'keyword', + }, + }, + }; + + mockClient.asCurrentUser.indices.create.mockImplementation(() => Promise.resolve()); + mockClient.asCurrentUser.indices.updateAliases.mockImplementation(() => Promise.resolve()); + await expect(setupAnalyticsCollectionIndex(mockClient.asCurrentUser as any)).resolves.toEqual( + undefined + ); + expect(mockClient.asCurrentUser.indices.create).toHaveBeenCalledWith({ + index: `${indexName}-v${1}`, + mappings: analyticCollectionsMappings, + settings: { auto_expand_replicas: '0-3', hidden: true, number_of_replicas: 0 }, + }); + expect(mockClient.asCurrentUser.indices.updateAliases).toHaveBeenCalledWith({ + actions: [ + { + add: { + aliases: [indexName], + index: `${indexName}-v${1}`, + is_hidden: true, + is_write_index: true, + }, + }, + ], + }); + }); + + it('should do nothing if it hits that resource already exists', async () => { + mockClient.asCurrentUser.indices.create.mockImplementation(() => + Promise.reject({ meta: { body: { error: { type: 'resource_already_exists_exception' } } } }) + ); + await expect(setupAnalyticsCollectionIndex(mockClient.asCurrentUser as any)).resolves.toEqual( + undefined + ); + expect(mockClient.asCurrentUser.indices.updateAliases).not.toHaveBeenCalled(); + expect(mockClient.asCurrentUser.indices.create).toHaveBeenCalled(); + }); +}); diff --git a/x-pack/plugins/enterprise_search/server/lib/analytics/setup_indices.ts b/x-pack/plugins/enterprise_search/server/lib/analytics/setup_indices.ts new file mode 100644 index 0000000000000..49a8aaca6f50f --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/analytics/setup_indices.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 { + IndicesIndexSettings, + MappingProperty, + MappingTypeMapping, +} from '@elastic/elasticsearch/lib/api/types'; +import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; + +import { ANALYTICS_COLLECTIONS_INDEX, ANALYTICS_VERSION } from '../..'; +import { isResourceAlreadyExistsException } from '../../utils/identify_exceptions'; + +const analyticsCollectionMappingsProperties: Record = { + event_retention_day_length: { + type: 'long', + }, + name: { + type: 'keyword', + }, +}; + +const defaultSettings: IndicesIndexSettings = { + auto_expand_replicas: '0-3', + hidden: true, + number_of_replicas: 0, +}; + +interface IndexDefinition { + aliases: string[]; + mappings: MappingTypeMapping; + name: string; + settings: IndicesIndexSettings; +} + +export const setupAnalyticsCollectionIndex = async (client: ElasticsearchClient) => { + const indexConfiguration: IndexDefinition = { + aliases: [ANALYTICS_COLLECTIONS_INDEX], + mappings: { + _meta: { + version: ANALYTICS_VERSION, + }, + properties: analyticsCollectionMappingsProperties, + }, + name: `${ANALYTICS_COLLECTIONS_INDEX}-v${ANALYTICS_VERSION}`, + settings: defaultSettings, + }; + + try { + const { mappings, aliases, name: index, settings } = indexConfiguration; + await client.indices.create({ + index, + mappings, + settings, + }); + await client.indices.updateAliases({ + actions: [ + { + add: { + aliases, + index, + is_hidden: true, + is_write_index: true, + }, + }, + ], + }); + } catch (error) { + if (isResourceAlreadyExistsException(error)) { + // index already exists, swallow error + return; + } + return error; + } +}; diff --git a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts index ac20e09284185..adb99b98a4226 100644 --- a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts @@ -40,13 +40,20 @@ describe('addConnector lib function', () => { asInternalUser: {}, }; + const createConnectorsIndexExistsFn = + (connectorsIndexExists: boolean, defaultValue: boolean) => + ({ index }: { index: string }) => + index === CONNECTORS_INDEX ? connectorsIndexExists : defaultValue; + beforeEach(() => { jest.clearAllMocks(); }); it('should add connector', async () => { mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(true, false) + ); (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => undefined); (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); @@ -82,7 +89,9 @@ describe('addConnector lib function', () => { it('should reject if index already exists', async () => { mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => true); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(true, true) + ); (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => undefined); (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); @@ -97,7 +106,9 @@ describe('addConnector lib function', () => { it('should reject if connector already exists', async () => { mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(true, false) + ); (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => true); (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); @@ -110,9 +121,28 @@ describe('addConnector lib function', () => { expect(mockClient.asCurrentUser.indices.create).not.toHaveBeenCalled(); }); + it('should reject if crawler already exists', async () => { + mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(true, false) + ); + (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => undefined); + (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => true); + + await expect( + addConnector(mockClient as unknown as IScopedClusterClient, { + index_name: 'index_name', + language: 'en', + }) + ).rejects.toEqual(new Error(ErrorCode.CRAWLER_ALREADY_EXISTS)); + expect(mockClient.asCurrentUser.indices.create).not.toHaveBeenCalled(); + }); + it('should reject with index already exists if connector and index already exist', async () => { mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => true); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(true, true) + ); (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => true); (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); @@ -127,7 +157,9 @@ describe('addConnector lib function', () => { it('should replace connector if deleteExistingConnector flag is true', async () => { mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(true, false) + ); (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => ({ id: 'connectorId' })); (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); @@ -167,13 +199,9 @@ describe('addConnector lib function', () => { }); it('should create index if no connectors index exists', async () => { - mockClient.asCurrentUser.index.mockImplementationOnce(() => { - return Promise.reject({ - meta: { body: { error: { type: 'index_not_found_exception' } } }, - statusCode: 404, - }); - }); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(false, false) + ); (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => false); (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); await expect( @@ -206,36 +234,4 @@ describe('addConnector lib function', () => { settings: textAnalysisSettings('en'), }); }); - it('should not create index if status code is not 404', async () => { - mockClient.asCurrentUser.index.mockImplementationOnce(() => { - return Promise.reject({ statusCode: 500 }); - }); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); - (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => false); - (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); - await expect( - addConnector(mockClient as unknown as IScopedClusterClient, { - index_name: 'index_name', - language: 'en', - }) - ).rejects.toEqual({ statusCode: 500 }); - expect(setupConnectorsIndices).not.toHaveBeenCalled(); - expect(mockClient.asCurrentUser.index).toHaveBeenCalledTimes(1); - }); - it('should not create index if crawler exists', async () => { - mockClient.asCurrentUser.index.mockImplementationOnce(() => { - return 'connector '; - }); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); - (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => false); - (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => 'crawler'); - await expect( - addConnector(mockClient as unknown as IScopedClusterClient, { - index_name: 'index_name', - language: 'en', - }) - ).rejects.toEqual(new Error(ErrorCode.CRAWLER_ALREADY_EXISTS)); - expect(setupConnectorsIndices).not.toHaveBeenCalled(); - expect(mockClient.asCurrentUser.index).not.toHaveBeenCalled(); - }); }); diff --git a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts index 8528b28582bf0..39a9d562106d0 100644 --- a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts +++ b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts @@ -11,7 +11,6 @@ import { CONNECTORS_INDEX } from '../..'; import { ConnectorDocument, ConnectorStatus } from '../../../common/types/connectors'; import { ErrorCode } from '../../../common/types/error_codes'; import { setupConnectorsIndices } from '../../index_management/setup_indices'; -import { isIndexNotFoundException } from '../../utils/identify_exceptions'; import { fetchCrawlerByIndexName } from '../crawler/fetch_crawlers'; import { textAnalysisSettings } from '../indices/text_analysis'; @@ -80,21 +79,11 @@ export const addConnector = async ( status: ConnectorStatus.CREATED, sync_now: false, }; - try { - return await createConnector( - document, - client, - input.language, - !!input.delete_existing_connector - ); - } catch (error) { - if (isIndexNotFoundException(error)) { - // This means .ent-search-connectors index doesn't exist yet - // So we first have to create it, and then try inserting the document again - await setupConnectorsIndices(client.asCurrentUser); - return await createConnector(document, client, input.language, false); - } else { - throw error; - } + const connectorsIndexExists = await client.asCurrentUser.indices.exists({ + index: CONNECTORS_INDEX, + }); + if (!connectorsIndexExists) { + await setupConnectorsIndices(client.asCurrentUser); } + return await createConnector(document, client, input.language, !!input.delete_existing_connector); }; diff --git a/x-pack/plugins/enterprise_search/server/plugin.ts b/x-pack/plugins/enterprise_search/server/plugin.ts index cfc3d8d196fd9..f9d23af141119 100644 --- a/x-pack/plugins/enterprise_search/server/plugin.ts +++ b/x-pack/plugins/enterprise_search/server/plugin.ts @@ -46,6 +46,7 @@ import { import { registerAppSearchRoutes } from './routes/app_search'; import { registerEnterpriseSearchRoutes } from './routes/enterprise_search'; +import { registerAnalyticsRoutes } from './routes/enterprise_search/analytics'; import { registerConfigDataRoute } from './routes/enterprise_search/config_data'; import { registerConnectorRoutes } from './routes/enterprise_search/connectors'; import { registerCrawlerRoutes } from './routes/enterprise_search/crawler/crawler'; @@ -168,6 +169,7 @@ export class EnterpriseSearchPlugin implements Plugin { // Enterprise Search Routes registerConnectorRoutes(dependencies); registerCrawlerRoutes(dependencies); + registerAnalyticsRoutes(dependencies); getStartServices().then(([, { security: securityStart }]) => { registerCreateAPIKeyRoute(dependencies, securityStart); diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.ts new file mode 100644 index 0000000000000..be53b797239a1 --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.ts @@ -0,0 +1,51 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { schema } from '@kbn/config-schema'; + +import { i18n } from '@kbn/i18n'; + +import { ErrorCode } from '../../../common/types/error_codes'; +import { addAnalyticsCollection } from '../../lib/analytics/add_analytics_collection'; +import { RouteDependencies } from '../../plugin'; +import { createError } from '../../utils/create_error'; +import { elasticsearchErrorHandler } from '../../utils/elasticsearch_error_handler'; + +export function registerAnalyticsRoutes({ router, log }: RouteDependencies) { + router.post( + { + path: '/internal/enterprise_search/analytics/collections', + validate: { + body: schema.object({ + name: schema.string(), + }), + }, + }, + elasticsearchErrorHandler(log, async (context, request, response) => { + const { client } = (await context.core).elasticsearch; + try { + const body = await addAnalyticsCollection(client, request.body); + return response.ok({ body }); + } catch (error) { + if ((error as Error).message === ErrorCode.ANALYTICS_COLLECTION_ALREADY_EXISTS) { + return createError({ + errorCode: (error as Error).message as ErrorCode, + message: i18n.translate( + 'xpack.enterpriseSearch.server.routes.addAnalyticsCollection.analyticsCollectionExistsError', + { + defaultMessage: 'Analytics collection already exists', + } + ), + response, + statusCode: 409, + }); + } + throw error; + } + }) + ); +} diff --git a/x-pack/plugins/event_log/scripts/create_schemas.js b/x-pack/plugins/event_log/scripts/create_schemas.js index 1a775b44add8d..dc4eeb01c8957 100755 --- a/x-pack/plugins/event_log/scripts/create_schemas.js +++ b/x-pack/plugins/event_log/scripts/create_schemas.js @@ -9,7 +9,7 @@ const fs = require('fs'); const path = require('path'); -const { set } = require('@elastic/safer-lodash-set'); +const { set } = require('@kbn/safer-lodash-set'); const lodash = require('lodash'); const LineWriter = require('./lib/line_writer'); diff --git a/x-pack/plugins/files/common/types.ts b/x-pack/plugins/files/common/types.ts index 2fef7ab3f17c4..d3c8795fc7321 100644 --- a/x-pack/plugins/files/common/types.ts +++ b/x-pack/plugins/files/common/types.ts @@ -332,7 +332,16 @@ export interface FileUnshareOptions { * A class with set of properties and behaviors of the "smart" file object and adds * behaviours for interacting with files on top of the pure data. */ -export interface File extends FileJSON { +export interface File { + /** + * The file ID + */ + id: string; + + /** + * File metadata in camelCase form. + */ + data: FileJSON; /** * Update a file object's metadatathat can be updated. * @@ -345,7 +354,7 @@ export interface File extends FileJSON { * * @param content - The content to stream to storage. */ - uploadContent(content: Readable): Promise; + uploadContent(content: Readable): Promise>; /** * Stream file content from storage. diff --git a/x-pack/plugins/files/server/file/file.test.ts b/x-pack/plugins/files/server/file/file.test.ts index ebb1efe32422c..1b86af89ba61c 100644 --- a/x-pack/plugins/files/server/file/file.test.ts +++ b/x-pack/plugins/files/server/file/file.test.ts @@ -82,4 +82,14 @@ describe('File', () => { await setImmediate(); expect(blobStoreSpy.calledOnce).toBe(true); }); + + it('updates file data after upload', async () => { + const fileSO = { attributes: { Status: 'AWAITING_UPLOAD' } }; + (soClient.create as jest.Mock).mockResolvedValue(fileSO); + (soClient.update as jest.Mock).mockResolvedValue(fileSO); + + const file = await fileService.createFile({ name: 'test', fileKind }); + await file.uploadContent(Readable.from(['test'])); + expect(file.data.status).toBe('READY'); + }); }); diff --git a/x-pack/plugins/files/server/file/file.ts b/x-pack/plugins/files/server/file/file.ts index 00544a7e14f08..bdf85af1bec0e 100644 --- a/x-pack/plugins/files/server/file/file.ts +++ b/x-pack/plugins/files/server/file/file.ts @@ -6,27 +6,11 @@ */ import { Logger } from '@kbn/core/server'; -import mimeType from 'mime'; import { Readable } from 'stream'; -import type { FileCompression, FileShareJSON, FileShareJSONWithToken } from '../../common/types'; -import type { - File as IFile, - FileKind, - FileMetadata, - FileStatus, - UpdatableFileMetadata, - FileJSON, -} from '../../common'; -import { - fileAttributesReducer, - Action, - createDefaultFileAttributes, -} from './file_attributes_reducer'; -import { createAuditEvent } from '../audit_events'; -import { InternalFileService } from '../file_service/internal_file_service'; -import { InternalFileShareService } from '../file_share_service'; +import type { FileShareJSON, FileShareJSONWithToken } from '../../common/types'; +import type { File as IFile, UpdatableFileMetadata, FileJSON } from '../../common'; +import { fileAttributesReducer, Action } from './file_attributes_reducer'; import type { FileClientImpl } from '../file_client/file_client'; -import { toJSON } from './to_json'; import { AlreadyDeletedError, ContentAlreadyUploadedError, @@ -35,46 +19,37 @@ import { } from './errors'; /** - * Public class that provides all data and functionality consumers will need at the - * individual file level + * Scopes file actions to an ID and set of attributes. * - * @note Instantiation should not happen outside of this plugin + * Also exposes the upload and download functionality. */ export class File implements IFile { - private readonly logAuditEvent: InternalFileService['writeAuditLog']; - constructor( public readonly id: string, - private fileMetadata: FileMetadata, + private metadata: FileJSON, private readonly fileClient: FileClientImpl, - private readonly internalFileService: InternalFileService, - private readonly fileShareService: InternalFileShareService, private readonly logger: Logger - ) { - this.logAuditEvent = this.internalFileService.writeAuditLog.bind(this.internalFileService); - } + ) {} - private async updateFileState(action: Action) { - const { metadata } = await this.fileClient.update({ - id: this.id, - metadata: fileAttributesReducer(this.metadata, action), - }); - this.fileMetadata = metadata; + private async updateFileState(action: Action): Promise { + const metadata = fileAttributesReducer(this.data, action); + await this.fileClient.internalUpdate(this.id, metadata); + this.data = metadata as FileJSON; } private isReady(): boolean { - return this.status === 'READY'; + return this.data.status === 'READY'; } private isDeleted(): boolean { - return this.status === 'DELETED'; + return this.data.status === 'DELETED'; } private uploadInProgress(): boolean { - return this.status === 'UPLOADING'; + return this.data.status === 'UPLOADING'; } - public async update(attrs: Partial): Promise { + public async update(attrs: Partial): Promise> { await this.updateFileState({ action: 'updateFile', payload: attrs, @@ -82,14 +57,14 @@ export class File implements IFile { return this; } - public async uploadContent(content: Readable): Promise { + public async uploadContent(content: Readable): Promise> { if (this.uploadInProgress()) { throw new UploadInProgressError('Upload already in progress.'); } if (this.isReady()) { throw new ContentAlreadyUploadedError('Already uploaded file content.'); } - this.logger.debug(`Uploading file [id = ${this.id}][name = ${this.name}].`); + this.logger.debug(`Uploading file [id = ${this.id}][name = ${this.data.name}].`); await this.updateFileState({ action: 'uploading', }); @@ -100,6 +75,7 @@ export class File implements IFile { action: 'uploaded', payload: { size }, }); + return this; } catch (e) { await this.updateFileState({ action: 'uploadError' }); this.fileClient.deleteContent(this.id).catch(() => {}); // Best effort to remove any uploaded content @@ -108,7 +84,7 @@ export class File implements IFile { } public downloadContent(): Promise { - const { size } = this.metadata; + const { size } = this.data; if (!this.isReady()) { throw new NoDownloadAvailableError('This file content is not available for download.'); } @@ -126,142 +102,38 @@ export class File implements IFile { await this.updateFileState({ action: 'delete', }); - // Stop sharing this file - await this.fileShareService.deleteForFile({ file: this }); await this.fileClient.delete({ id: this.id, hasContent: this.isReady() }); - this.logAuditEvent( - createAuditEvent({ - action: 'delete', - outcome: 'success', - message: `Deleted file "${this.name}" of kind "${this.fileKind}" with id "${this.id}"`, - }) - ); } public async share({ name, validUntil, }: { - name?: string; + name: string; validUntil?: number; }): Promise { - const shareObject = await this.fileShareService.share({ file: this, name, validUntil }); - this.internalFileService.writeAuditLog( - createAuditEvent({ - action: 'create', - message: `Shared file "${this.name}" with id "${this.id}"`, - }) - ); - return shareObject; + return this.fileClient.share({ name, validUntil, file: this }); } async listShares(): Promise { - const { shares } = await this.fileShareService.list({ fileId: this.id }); + const { shares } = await this.fileClient.listShares({ + fileId: this.id, + }); return shares; } async unshare(opts: { shareId: string }): Promise { - await this.fileShareService.delete({ id: opts.shareId }); - this.internalFileService.writeAuditLog( - createAuditEvent({ - action: 'delete', - message: `Removed share for "${this.name}" with id "${this.id}"`, - }) - ); + await this.fileClient.unshare({ id: opts.shareId }); } public toJSON(): FileJSON { - return toJSON(this.id, this.metadata); - } - - private get metadata(): FileMetadata { - return this.fileMetadata; - } - - public get created(): string { - return this.metadata.created; - } - - public get updated(): string { - return this.metadata.Updated; - } - - public get chunkSize(): number | undefined { - return this.metadata.ChunkSize; - } - - public get fileKind(): string { - return this.fileClient.fileKind; - } - - public get name(): string { - return this.metadata.name; + return this.data; } - public get status(): FileStatus { - return this.metadata.Status; + public get data(): FileJSON { + return this.metadata; } - - public get compression(): undefined | FileCompression { - return this.metadata.Compression; - } - - public get size(): undefined | number { - return this.metadata.size; - } - - public get meta(): M { - return this.metadata.Meta as M; - } - - public get alt(): undefined | string { - return this.metadata.Alt; - } - - public get mimeType(): undefined | string { - return this.metadata.mime_type; - } - - public get extension(): undefined | string { - return this.metadata.extension; - } - - /** - * Static method for creating files so that we can keep all of the audit logging for files - * in the same place. - */ - public static async create( - { - name, - fileKind, - alt, - meta, - mime, - }: { name: string; fileKind: FileKind; alt?: string; meta?: unknown; mime?: string }, - internalFileService: InternalFileService, - fileClient: FileClientImpl - ) { - const fileMeta = await fileClient.create({ - metadata: { - ...createDefaultFileAttributes(), - name, - mime_type: mime, - Alt: alt, - Meta: meta, - FileKind: fileKind.id, - extension: (mime && mimeType.getExtension(mime)) ?? undefined, - }, - }); - - const file = internalFileService.toFile(fileMeta.id, fileMeta.metadata, fileKind, fileClient); - - internalFileService.writeAuditLog( - createAuditEvent({ - action: 'create', - message: `Created file "${file.name}" of kind "${file.fileKind}" and id "${file.id}"`, - }) - ); - - return file; + private set data(v: FileJSON) { + this.metadata = v; } } diff --git a/x-pack/plugins/files/server/file/file_attributes_reducer.ts b/x-pack/plugins/files/server/file/file_attributes_reducer.ts index 93bf2f74545d9..fdb2768408af5 100644 --- a/x-pack/plugins/files/server/file/file_attributes_reducer.ts +++ b/x-pack/plugins/files/server/file/file_attributes_reducer.ts @@ -4,8 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import moment from 'moment'; -import { FileMetadata, UpdatableFileMetadata } from '../../common'; +import { FileJSON, UpdatableFileMetadata } from '../../common'; export type Action = | { @@ -20,51 +19,32 @@ export type Action = | { action: 'uploadError'; payload?: undefined } | { action: 'updateFile'; payload: Partial }; -export function createDefaultFileAttributes(): Pick< - FileMetadata, - 'created' | 'Updated' | 'Status' -> { - const dateString = new Date().toISOString(); - return { - created: dateString, - Status: 'AWAITING_UPLOAD', - Updated: dateString, - }; -} - -export function fileAttributesReducer( - state: FileMetadata, - { action, payload }: Action -): FileMetadata { +export function fileAttributesReducer(state: FileJSON, { action, payload }: Action): FileJSON { switch (action) { case 'delete': - return { ...state, Status: 'DELETED' }; + return { ...state, status: 'DELETED' }; case 'uploading': return { ...state, - Status: 'UPLOADING', - Updated: moment().toISOString(), + status: 'UPLOADING', }; case 'uploaded': return { ...state, ...payload, - Status: 'READY', - Updated: moment().toISOString(), + status: 'READY', }; case 'uploadError': return { ...state, - Status: 'UPLOAD_ERROR', - Updated: moment().toISOString(), + status: 'UPLOAD_ERROR', }; case 'updateFile': return { ...state, name: payload.name ?? state.name, - Alt: payload.alt ?? state.Alt, - Meta: payload.meta ?? state.Meta, - Updated: moment().toISOString(), + alt: payload.alt ?? state.alt, + meta: payload.meta ?? state.meta, }; default: return state; diff --git a/x-pack/plugins/files/server/file/index.ts b/x-pack/plugins/files/server/file/index.ts index 02740d7eaab6d..2b584945cb71f 100644 --- a/x-pack/plugins/files/server/file/index.ts +++ b/x-pack/plugins/files/server/file/index.ts @@ -9,6 +9,6 @@ import * as fileErrors from './errors'; export { File } from './file'; export { toJSON } from './to_json'; -export { createDefaultFileAttributes, fileAttributesReducer } from './file_attributes_reducer'; +export { fileAttributesReducer } from './file_attributes_reducer'; export type { Action } from './file_attributes_reducer'; export { fileErrors }; diff --git a/x-pack/plugins/files/server/file/to_json.ts b/x-pack/plugins/files/server/file/to_json.ts index 390aa1672e06e..98096940fe75f 100644 --- a/x-pack/plugins/files/server/file/to_json.ts +++ b/x-pack/plugins/files/server/file/to_json.ts @@ -5,8 +5,28 @@ * 2.0. */ +import { pickBy } from 'lodash'; import type { FileMetadata, FileJSON } from '../../common/types'; +export function serializeJSON(attrs: Partial): Partial { + const { name, mimeType, size, created, updated, fileKind, status, alt, extension, meta } = attrs; + return pickBy( + { + name, + mime_type: mimeType, + size, + created, + extension, + Alt: alt, + Status: status, + Meta: meta as M, + Updated: updated, + FileKind: fileKind, + }, + (v) => v != null + ); +} + export function toJSON(id: string, attrs: FileMetadata): FileJSON { const { name, @@ -20,17 +40,20 @@ export function toJSON(id: string, attrs: FileMetadata): FileJSON>( + { + id, + name, + mimeType, + size, + created, + extension, + alt: Alt, + status: Status, + meta: Meta as M, + updated: Updated, + fileKind: FileKind, + }, + (v) => v != null + ) as FileJSON; } diff --git a/x-pack/plugins/files/server/file_client/create_es_file_client.ts b/x-pack/plugins/files/server/file_client/create_es_file_client.ts index 2ffb9bd458c6d..9f453a6a25bfc 100644 --- a/x-pack/plugins/files/server/file_client/create_es_file_client.ts +++ b/x-pack/plugins/files/server/file_client/create_es_file_client.ts @@ -7,7 +7,8 @@ import type { Logger, ElasticsearchClient } from '@kbn/core/server'; import { ElasticsearchBlobStorageClient } from '../blob_storage_service'; -import { FileClientImpl, FileClient } from './file_client'; +import { FileClientImpl } from './file_client'; +import type { FileClient } from './types'; import { EsIndexFilesMetadataClient } from './file_metadata_client'; const NO_FILE_KIND = 'none'; @@ -55,6 +56,9 @@ export function createEsFileClient(arg: CreateEsFileClientArgs): FileClient { maxSizeBytes, }, new EsIndexFilesMetadataClient(metadataIndex, elasticsearchClient, logger), - new ElasticsearchBlobStorageClient(elasticsearchClient, blobStorageIndex, undefined, logger) + new ElasticsearchBlobStorageClient(elasticsearchClient, blobStorageIndex, undefined, logger), + undefined, + undefined, + logger ); } diff --git a/x-pack/plugins/files/server/file_client/file_client.ts b/x-pack/plugins/files/server/file_client/file_client.ts index cc9a4a6de2994..595d0095a6625 100644 --- a/x-pack/plugins/files/server/file_client/file_client.ts +++ b/x-pack/plugins/files/server/file_client/file_client.ts @@ -4,165 +4,170 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import moment from 'moment'; import { Readable } from 'stream'; +import mimeType from 'mime'; import cuid from 'cuid'; -import { FileKind, FileMetadata } from '../../common/types'; +import type { Logger } from '@kbn/core/server'; +import type { AuditLogger } from '@kbn/security-plugin/server'; +import type { + File, + FileJSON, + FileKind, + FileMetadata, + FileShareJSONWithToken, + UpdatableFileMetadata, +} from '../../common/types'; import type { FileMetadataClient } from './file_metadata_client'; import type { BlobStorageClient, UploadOptions as BlobUploadOptions, } from '../blob_storage_service'; +import { File as FileImpl } from '../file'; +import { FileShareServiceStart, InternalFileShareService } from '../file_share_service'; import { enforceMaxByteSizeTransform } from './stream_transforms'; - -export interface DeleteArgs { - /** ID of the file to delete */ - id: string; - /** - * If `true`, the file will be deleted from the blob storage. - * - * @default true - */ - hasContent?: boolean; -} - -/** - * Args to create a file - */ -export interface CreateArgs { - /** - * Unique file ID - */ - id?: string; - /** - * The file's metadata - */ - metadata: Omit & { FileKind?: string }; -} +import { createAuditEvent } from '../audit_events'; +import type { FileClient, CreateArgs, DeleteArgs, P1, ShareArgs } from './types'; +import { serializeJSON, toJSON } from '../file/to_json'; +import { createDefaultFileAttributes } from './utils'; export type UploadOptions = Omit; -/** - * Wraps the {@link FileMetadataClient} and {@link BlobStorageClient} client - * to provide basic file CRUD functionality. - * - * For now this is just a shallow type of the implementation for export purposes. - */ -export interface FileClient { - /** See {@link FileMetadata.FileKind}. */ - fileKind: string; - - /** - * See {@link FileMetadataClient.create}. - * - * @param arg - Arg to create a file. - * */ - create(arg: CreateArgs): ReturnType; - - /** - * See {@link FileMetadataClient.get} - * - * @param arg - Argument to get a file - */ - get: FileMetadataClient['get']; - - /** - * {@link FileMetadataClient.update} - * - * @param arg - Argument to get a file - */ - update: FileMetadataClient['update']; - - /** - * Delete a file. - * @param arg - Argument to delete a file - */ - delete(arg: DeleteArgs): Promise; - - /** - * See {@link BlobStorageClient.delete} - * - * @param id - Argument to delete a file - */ - deleteContent: BlobStorageClient['delete']; - - /** - * See {@link FileMetadataClient.list} - * - * @param arg - Argument to list files - */ - list: FileMetadataClient['list']; - - /** - * See {@link FileMetadataClient.find}. - * - * @param arg - Argument to find files - */ - find: FileMetadataClient['find']; - - /** - * See {@link BlobStorageClient.upload} - * - * @param id - Readable stream to upload - * @param rs - Readable stream to upload - * @param opts - Argument for uploads - */ - upload(id: string, rs: Readable, opts?: UploadOptions): ReturnType; - - /** - * See {@link BlobStorageClient.download} - * - * @param args - to download a file - */ - download: BlobStorageClient['download']; +export function createFileClient({ + fileKindDescriptor, + auditLogger, + blobStorageClient, + internalFileShareService, + logger, + metadataClient, +}: { + fileKindDescriptor: FileKind; + metadataClient: FileMetadataClient; + blobStorageClient: BlobStorageClient; + internalFileShareService: undefined | InternalFileShareService; + auditLogger: undefined | AuditLogger; + logger: Logger; +}) { + return new FileClientImpl( + fileKindDescriptor, + metadataClient, + blobStorageClient, + internalFileShareService, + auditLogger, + logger + ); } + export class FileClientImpl implements FileClient { + private readonly logAuditEvent: AuditLogger['log']; + constructor( private fileKindDescriptor: FileKind, private readonly metadataClient: FileMetadataClient, - private readonly blobStorageClient: BlobStorageClient - ) {} + private readonly blobStorageClient: BlobStorageClient, + private readonly internalFileShareService: undefined | InternalFileShareService, + auditLogger: undefined | AuditLogger, + private readonly logger: Logger + ) { + this.logAuditEvent = (e) => { + if (auditLogger) { + auditLogger.log(e); + } else if (e) { + this.logger.info(JSON.stringify(e.event, null, 2)); + } + }; + } + + private instantiateFile(id: string, metadata: FileMetadata): File { + return new FileImpl( + id, + toJSON(id, { + ...createDefaultFileAttributes(), + ...metadata, + }), + this, + this.logger + ); + } public get fileKind(): string { return this.fileKindDescriptor.id; } - public create = async ({ - id, - metadata, - }: CreateArgs): ReturnType => { - return this.metadataClient.create({ + public async create({ id, metadata }: CreateArgs): Promise> { + const serializedMetadata = serializeJSON({ ...metadata, mimeType: metadata.mime }); + const result = await this.metadataClient.create({ id: id || cuid(), metadata: { + ...createDefaultFileAttributes(), + ...serializedMetadata, + name: serializedMetadata.name!, + extension: + (serializedMetadata.mime_type && mimeType.getExtension(serializedMetadata.mime_type)) ?? + undefined, FileKind: this.fileKind, - ...metadata, }, }); - }; + this.logAuditEvent( + createAuditEvent({ + action: 'create', + message: `Created file "${result.metadata.name}" of kind "${this.fileKind}" and id "${result.id}"`, + }) + ); + return this.instantiateFile(result.id, { + ...result.metadata, + FileKind: this.fileKind, + }) as File; + } - public get: FileMetadataClient['get'] = async (arg) => { - return this.metadataClient.get(arg); - }; + public async get(arg: P1): Promise> { + const { id, metadata } = await this.metadataClient.get(arg); + return this.instantiateFile(id, metadata as FileMetadata); + } - public update: FileMetadataClient['update'] = (arg) => { - return this.metadataClient.update(arg); - }; + public async internalUpdate(id: string, metadata: Partial): Promise { + await this.metadataClient.update({ id, metadata: serializeJSON(metadata) }); + } - public find: FileMetadataClient['find'] = (arg) => { - return this.metadataClient.find(arg); - }; + public async update(id: string, metadata: UpdatableFileMetadata): Promise { + const { alt, meta, name } = metadata; + const payload = { name, alt, meta, updated: moment().toISOString() }; + await this.internalUpdate(id, payload); + } + + public async find(arg: P1): Promise>> { + return this.metadataClient + .find(arg) + .then((r) => + r.map(({ id, metadata }) => this.instantiateFile(id, metadata as FileMetadata)) + ); + } public async delete({ id, hasContent = true }: DeleteArgs) { + if (this.internalFileShareService) { + // Stop sharing this file + await this.internalFileShareService.deleteForFile({ id }); + } if (hasContent) await this.blobStorageClient.delete(id); - return this.metadataClient.delete({ id }); + await this.metadataClient.delete({ id }); + this.logAuditEvent( + createAuditEvent({ + action: 'delete', + outcome: 'success', + message: `Deleted file with "${id}"`, + }) + ); } public deleteContent: BlobStorageClient['delete'] = (arg) => { return this.blobStorageClient.delete(arg); }; - public list: FileMetadataClient['list'] = (arg) => { - return this.metadataClient.list(arg); - }; + public async list(arg?: P1): Promise { + return this.metadataClient + .list(arg) + .then((r) => r.map(({ id, metadata }) => this.instantiateFile(id, metadata))); + } /** * Upload a blob @@ -188,4 +193,45 @@ export class FileClientImpl implements FileClient { public download: BlobStorageClient['download'] = (args) => { return this.blobStorageClient.download(args); }; + + async share({ file, name, validUntil }: ShareArgs): Promise { + if (!this.internalFileShareService) { + throw new Error('#share not implemented'); + } + const shareObject = await this.internalFileShareService.share({ + file, + name, + validUntil, + }); + this.logAuditEvent( + createAuditEvent({ + action: 'create', + message: `Shared file "${file.data.name}" with id "${file.data.id}"`, + }) + ); + return shareObject; + } + + unshare: FileShareServiceStart['delete'] = async (arg) => { + if (!this.internalFileShareService) { + throw new Error('#delete shares is not implemented'); + } + const result = await this.internalFileShareService.delete(arg); + + this.logAuditEvent( + createAuditEvent({ + action: 'delete', + message: `Removed share with id "${arg.id}"`, + }) + ); + + return result; + }; + + listShares: FileShareServiceStart['list'] = (args) => { + if (!this.internalFileShareService) { + throw new Error('#list shares not implemented'); + } + return this.internalFileShareService.list(args); + }; } diff --git a/x-pack/plugins/files/server/file_client/index.ts b/x-pack/plugins/files/server/file_client/index.ts index 2f764a53224e4..cb9c2187bc996 100644 --- a/x-pack/plugins/files/server/file_client/index.ts +++ b/x-pack/plugins/files/server/file_client/index.ts @@ -17,6 +17,12 @@ export type { UpdateMetadataArg, } from './file_metadata_client'; export { FileClientImpl } from './file_client'; -export type { FileClient } from './file_client'; +export type { FileClient } from './types'; export { createEsFileClient } from './create_es_file_client'; export type { CreateEsFileClientArgs } from './create_es_file_client'; +export { + AlreadyDeletedError, + ContentAlreadyUploadedError, + NoDownloadAvailableError, + UploadInProgressError, +} from '../file/errors'; diff --git a/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts b/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts index 3ab200533c6da..19abeafa786dc 100644 --- a/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts +++ b/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts @@ -8,7 +8,8 @@ import { Readable } from 'stream'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { TestEnvironmentUtils, setupIntegrationEnvironment } from '../../test_utils'; import { createEsFileClient } from '../create_es_file_client'; -import { FileClient } from '../file_client'; +import { FileClient } from '../types'; +import { FileMetadata } from '../../../common'; /** * This file client is using Elasticsearch interfaces directly to manage files. @@ -17,6 +18,8 @@ describe('ES-index-backed file client', () => { let esClient: TestEnvironmentUtils['esClient']; let fileClient: FileClient; let testHarness: TestEnvironmentUtils; + const blobStorageIndex = '.kibana-test-blob'; + const metadataIndex = '.kibana-test-metadata'; beforeAll(async () => { testHarness = await setupIntegrationEnvironment(); @@ -25,8 +28,8 @@ describe('ES-index-backed file client', () => { beforeEach(() => { fileClient = createEsFileClient({ - blobStorageIndex: '.kibana-test-blob', - metadataIndex: '.kibana-test-metadata', + blobStorageIndex, + metadataIndex, elasticsearchClient: esClient, logger: loggingSystemMock.create().get(), }); @@ -40,64 +43,46 @@ describe('ES-index-backed file client', () => { const file = await fileClient.create({ id: '123', metadata: { - Status: 'AWAITING_UPLOAD', - created: new Date().toISOString(), - Updated: new Date().toISOString(), name: 'cool name', }, }); - expect(file).toEqual( + expect(file.toJSON()).toEqual( expect.objectContaining({ id: '123', - metadata: { - FileKind: 'none', - Status: 'AWAITING_UPLOAD', - Updated: expect.any(String), - created: expect.any(String), - name: 'cool name', - }, + fileKind: 'none', + status: 'AWAITING_UPLOAD', + updated: expect.any(String), + created: expect.any(String), + name: 'cool name', }) ); await fileClient.delete({ id: file.id, hasContent: false }); }); test('uploads and downloads file content', async () => { - let { id, metadata } = await fileClient.create({ + const file = await fileClient.create({ id: '123', metadata: { - Status: 'AWAITING_UPLOAD', - created: new Date().toISOString(), - Updated: new Date().toISOString(), name: 'cool name', }, }); - - const { size } = await fileClient.upload(id, Readable.from([Buffer.from('test')])); - ({ id, metadata } = await fileClient.update({ - id, - metadata: { ...metadata, size, Status: 'READY' }, - })); - - const file = await fileClient.get({ id }); - const rs = await fileClient.download({ id: file.id, size: file.metadata.size }); + await file.uploadContent(Readable.from([Buffer.from('test')])); + const rs = await file.downloadContent(); const chunks: Buffer[] = []; for await (const chunk of rs) { chunks.push(chunk); } expect(Buffer.concat(chunks).toString('utf-8')).toBe('test'); - await fileClient.delete({ id, hasContent: true }); + await fileClient.delete({ id: file.id, hasContent: true }); }); test('searches across files', async () => { const { id: id1 } = await fileClient.create({ id: '123', metadata: { - Status: 'AWAITING_UPLOAD', - created: new Date().toISOString(), - Updated: new Date().toISOString(), name: 'cool name 1', - Meta: { + meta: { test: '1', }, }, @@ -105,28 +90,24 @@ describe('ES-index-backed file client', () => { const { id: id2 } = await fileClient.create({ id: '1234', metadata: { - Status: 'UPLOADING', - created: new Date().toISOString(), - Updated: new Date().toISOString(), name: 'cool name 2', - Meta: { + meta: { test: '2', }, }, }); - const { id: id3 } = await fileClient.create({ + const file3 = await fileClient.create({ id: '12345', metadata: { - Status: 'READY', - created: new Date().toISOString(), - Updated: new Date().toISOString(), name: 'cool name 3', - Meta: { + meta: { test: '3', }, }, }); + await file3.uploadContent(Readable.from(['test'])); + { const results = await fileClient.find({ status: ['READY'], @@ -137,7 +118,7 @@ describe('ES-index-backed file client', () => { expect(results[0]).toEqual( expect.objectContaining({ - id: id3, + id: file3.id, }) ); } @@ -147,7 +128,7 @@ describe('ES-index-backed file client', () => { status: ['READY', 'AWAITING_UPLOAD'], }); - expect(results).toHaveLength(2); + expect(results).toHaveLength(3); expect(results[0]).toEqual( expect.objectContaining({ @@ -157,7 +138,13 @@ describe('ES-index-backed file client', () => { expect(results[1]).toEqual( expect.objectContaining({ - id: id3, + id: id2, + }) + ); + + expect(results[2]).toEqual( + expect.objectContaining({ + id: file3.id, }) ); } @@ -165,7 +152,7 @@ describe('ES-index-backed file client', () => { await Promise.all([ fileClient.delete({ id: id1 }), fileClient.delete({ id: id2 }), - fileClient.delete({ id: id3 }), + fileClient.delete({ id: file3.id }), ]); }); @@ -173,24 +160,23 @@ describe('ES-index-backed file client', () => { const { id: id1 } = await fileClient.create({ id: '123', metadata: { - Status: 'AWAITING_UPLOAD', - created: new Date().toISOString(), - Updated: new Date().toISOString(), name: 'cool name 1', - Meta: { + meta: { test: '1', }, }, }); - const { id: id2 } = await fileClient.create({ - id: '1234', - metadata: { - Status: 'DELETED', - created: new Date().toISOString(), - Updated: new Date().toISOString(), - name: 'cool name 2', - Meta: { - test: '2', + const id2 = '1234'; + await esClient.index<{ file: FileMetadata }>({ + id: id2, + index: metadataIndex, + document: { + file: { + FileKind: 'none', + Status: 'DELETED', + Updated: new Date().toISOString(), + created: new Date().toISOString(), + name: 'coolname', }, }, }); @@ -198,17 +184,15 @@ describe('ES-index-backed file client', () => { const list = await fileClient.list(); expect(list).toHaveLength(1); - expect(list[0]).toEqual( + expect(list[0].toJSON()).toEqual( expect.objectContaining({ id: '123', - metadata: { - FileKind: 'none', - Meta: { test: '1' }, - Status: 'AWAITING_UPLOAD', - Updated: expect.any(String), - created: expect.any(String), - name: 'cool name 1', - }, + fileKind: 'none', + meta: { test: '1' }, + status: 'AWAITING_UPLOAD', + updated: expect.any(String), + created: expect.any(String), + name: 'cool name 1', }) ); diff --git a/x-pack/plugins/files/server/file_client/types.ts b/x-pack/plugins/files/server/file_client/types.ts new file mode 100644 index 0000000000000..bbab0066cf3f0 --- /dev/null +++ b/x-pack/plugins/files/server/file_client/types.ts @@ -0,0 +1,134 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { File, FileShareJSONWithToken, UpdatableFileMetadata } from '../../common/types'; +import { CreateFileArgs } from '../file_service'; +import { FileShareServiceStart } from '../file_share_service'; +import { FileMetadataClient } from './file_metadata_client'; + +export type P1 any> = Parameters[0]; + +export interface DeleteArgs { + /** ID of the file to delete */ + id: string; + /** + * If `true`, the file will be deleted from the blob storage. + * + * @default true + */ + hasContent?: boolean; +} + +/** + * Args to create a file + */ +export interface CreateArgs { + /** + * Unique file ID + */ + id?: string; + /** + * The file's metadata + */ + metadata: Omit; +} + +/** + * File share args + */ +export interface ShareArgs { + /** + * Name of the file share + */ + name?: string; + /** + * Unix timestamp (in milliseconds) when the file share will expire + */ + validUntil?: number; + /** + * The file to share + */ + file: File; +} + +/** + * Wraps the {@link FileMetadataClient} and {@link BlobStorageClient} client + * to provide basic file CRUD functionality. + * + * For now this is just a shallow type of the implementation for export purposes. + */ +export interface FileClient { + /** See {@link FileMetadata.FileKind}. */ + fileKind: string; + + /** + * See {@link FileMetadataClient.create}. + * + * @param arg - Arg to create a file. + * */ + create(arg: CreateArgs): Promise>; + + /** + * See {@link FileMetadataClient.get} + * + * @param arg - Argument to get a file + */ + get(arg: P1): Promise>; + + /** + * {@link FileMetadataClient.update} + * + * @param id - File id + * @param metadata - new file metadata + */ + update(id: string, metadata: UpdatableFileMetadata): Promise; + + /** + * Delete a file. + * @param arg - Argument to delete a file + */ + delete(arg: DeleteArgs): Promise; + + /** + * See {@link FileMetadataClient.list} + * + * @param arg - Argument to list files + */ + list(arg?: P1): Promise; + + /** + * See {@link FileMetadataClient.find}. + * + * @param arg - Argument to find files + */ + find: (arg: P1) => Promise; + + /** + * Create a file share instance for this file. + * + * @note this will only work for files that are share capable. + * + * @param args - Arguments to create a file share + */ + share(args: ShareArgs): Promise; + /** + * Create a file share instance for this file. + * + * @note this will only work for files that are share capable. + * + * @param args - Arguments to remove a file share + */ + unshare: FileShareServiceStart['delete']; + /** + * Create a file share instance for this file. + * + * @note this will only work for files that are share capable. + * + * @param arg - Arguments to remove a file share + */ + listShares: FileShareServiceStart['list']; +} diff --git a/x-pack/plugins/files/server/file_client/utils.ts b/x-pack/plugins/files/server/file_client/utils.ts new file mode 100644 index 0000000000000..b8b51117e8ac1 --- /dev/null +++ b/x-pack/plugins/files/server/file_client/utils.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { FileMetadata } from '../../common'; + +export function createDefaultFileAttributes(): Pick< + FileMetadata, + 'created' | 'Updated' | 'Status' +> { + const dateString = new Date().toISOString(); + return { + created: dateString, + Status: 'AWAITING_UPLOAD', + Updated: dateString, + }; +} diff --git a/x-pack/plugins/files/server/file_service/file_service.ts b/x-pack/plugins/files/server/file_service/file_service.ts index 90303ac715437..f8d8534b7a635 100644 --- a/x-pack/plugins/files/server/file_service/file_service.ts +++ b/x-pack/plugins/files/server/file_service/file_service.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { File, FileJSON, FilesMetrics } from '../../common'; +import type { FileJSON, FilesMetrics, File } from '../../common'; import type { FileShareServiceStart } from '../file_share_service/types'; import type { CreateFileArgs, @@ -34,7 +34,7 @@ export interface FileServiceStart { * * @param args - update file args */ - update(args: UpdateFileArgs): Promise>; + update(args: UpdateFileArgs): Promise; /** * Delete a file. diff --git a/x-pack/plugins/files/server/file_service/file_service_factory.ts b/x-pack/plugins/files/server/file_service/file_service_factory.ts index bed007b00e507..b6603a43f8720 100644 --- a/x-pack/plugins/files/server/file_service/file_service_factory.ts +++ b/x-pack/plugins/files/server/file_service/file_service_factory.ts @@ -95,7 +95,7 @@ export class FileServiceFactoryImpl implements FileServiceFactory { return internalFileService.createFile(args) as Promise>; }, async update(args: UpdateFileArgs) { - return internalFileService.updateFile(args) as Promise>; + await internalFileService.updateFile(args); }, async delete(args) { return internalFileService.deleteFile(args); diff --git a/x-pack/plugins/files/server/file_service/internal_file_service.ts b/x-pack/plugins/files/server/file_service/internal_file_service.ts index 567df3e137848..a7ba92db9b2e8 100644 --- a/x-pack/plugins/files/server/file_service/internal_file_service.ts +++ b/x-pack/plugins/files/server/file_service/internal_file_service.ts @@ -23,7 +23,7 @@ import type { GetByIdArgs, ListFilesArgs, } from './file_action_types'; -import { FileClientImpl } from '../file_client/file_client'; +import { createFileClient, FileClientImpl } from '../file_client/file_client'; /** * Service containing methods for working with files. * @@ -42,16 +42,7 @@ export class InternalFileService { ) {} public async createFile(args: CreateFileArgs): Promise { - const fileKind = this.getFileKind(args.fileKind); - return await File.create( - { ...args, fileKind }, - this, - new FileClientImpl( - fileKind, - this.metadataClient, - this.blobStorageService.createBlobStorageClient(fileKind.blobStoreSettings) - ) - ); + return this.createFileClient(args.fileKind).create({ metadata: { ...args } }); } public writeAuditLog(event: AuditEvent) { @@ -79,7 +70,7 @@ export class InternalFileService { if (metadata.Status === 'DELETED') { throw new FileNotFoundError('File has been deleted'); } - return this.toFile(id, metadata, this.getFileKind(metadata.FileKind)); + return this.toFile(id, metadata, metadata.FileKind); } catch (e) { if (SavedObjectsErrorHelpers.isNotFoundError(e)) { throw new FileNotFoundError('File not found'); @@ -91,8 +82,8 @@ export class InternalFileService { public async getById({ fileKind, id }: GetByIdArgs): Promise { const file = await this.get(id); - if (file.fileKind !== fileKind) { - throw new Error(`Unexpected file kind "${file.fileKind}", expected "${fileKind}".`); + if (file.data.fileKind !== fileKind) { + throw new Error(`Unexpected file kind "${file.data.fileKind}", expected "${fileKind}".`); } return file; } @@ -108,28 +99,8 @@ export class InternalFileService { page, perPage, }); - return result.map((file) => this.toFile(file.id, file.metadata, fileKind)); - } - - public toFile( - id: string, - fileMetadata: FileMetadata, - fileKind: FileKind, - fileClient?: FileClientImpl - ): IFile { - return new File( - id, - fileMetadata, - fileClient ?? - new FileClientImpl( - fileKind, - this.metadataClient, - this.blobStorageService.createBlobStorageClient(fileKind.blobStoreSettings) - ), - this, - this.fileShareService, - this.logger.get(`file-${id}`) - ); + const fileClient = this.createFileClient(fileKind.id); + return result.map((file) => this.toFile(file.id, file.metadata, fileKind.id, fileClient)); } public getFileKind(id: string): FileKind { @@ -153,4 +124,32 @@ export class InternalFileService { const { fileId } = await this.fileShareService.getByToken(token); return this.get(fileId); } + + private toFile( + id: string, + fileMetadata: FileMetadata, + fileKind: string, + fileClient?: FileClientImpl + ): IFile { + return new File( + id, + toJSON(id, fileMetadata), + fileClient ?? this.createFileClient(fileKind), + this.logger.get(`file-${id}`) + ); + } + + private createFileClient(fileKindId: string) { + const fileKind = this.fileKindRegistry.get(fileKindId); + return createFileClient({ + auditLogger: this.auditLogger, + blobStorageClient: this.blobStorageService.createBlobStorageClient( + fileKind.blobStoreSettings + ), + fileKindDescriptor: fileKind, + internalFileShareService: this.fileShareService, + logger: this.logger, + metadataClient: this.metadataClient, + }); + } } diff --git a/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts b/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts index 7b6f8498b0e3e..6c9e09e5173b4 100644 --- a/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts +++ b/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts @@ -85,9 +85,9 @@ export type GetArgs = IdArg; */ export interface DeleteForFileArgs { /** - * The file object to delete the shares for. + * The file id to delete the shares for. */ - file: File; + id: string; } /** @@ -144,7 +144,7 @@ export class InternalFileShareService implements FileShareServiceStart { token: generateShareToken(), }, { - references: [{ name: file.name, id: file.id, type: FILE_SO_TYPE }], + references: [{ name: file.data.name, id: file.data.id, type: FILE_SO_TYPE }], } ); @@ -183,8 +183,8 @@ export class InternalFileShareService implements FileShareServiceStart { return result.saved_objects; } - public async deleteForFile({ file }: DeleteForFileArgs): Promise { - const savedObjects = await this.internalList({ fileId: file.id }); + public async deleteForFile({ id: fileId }: DeleteForFileArgs): Promise { + const savedObjects = await this.internalList({ fileId }); await Promise.all(savedObjects.map(({ id }) => this.delete({ id }))); } diff --git a/x-pack/plugins/files/server/integration_tests/file_service.test.ts b/x-pack/plugins/files/server/integration_tests/file_service.test.ts index 0547fe0ed30fb..61196597cc5f9 100644 --- a/x-pack/plugins/files/server/integration_tests/file_service.test.ts +++ b/x-pack/plugins/files/server/integration_tests/file_service.test.ts @@ -107,9 +107,9 @@ describe('FileService', () => { it('creates file metadata awaiting upload', async () => { const file = await createDisposableFile({ fileKind, name: 'test' }); - expect(file.name).toEqual('test'); - expect(file.fileKind).toEqual(fileKind); - expect(file.status).toBe('AWAITING_UPLOAD' as FileStatus); + expect(file.data.name).toEqual('test'); + expect(file.data.fileKind).toEqual(fileKind); + expect(file.data.status).toBe('AWAITING_UPLOAD' as FileStatus); expect(auditLogger.log).toHaveBeenCalledTimes(1); expect(auditLogger.log).toHaveBeenCalledWith({ error: undefined, @@ -123,9 +123,9 @@ describe('FileService', () => { it('uploads file content', async () => { const file = await createDisposableFile({ fileKind, name: 'test' }); - expect(file.status).toBe('AWAITING_UPLOAD' as FileStatus); + expect(file.data.status).toBe('AWAITING_UPLOAD' as FileStatus); await file.uploadContent(Readable.from(['upload this'])); - expect(file.status).toBe('READY' as FileStatus); + expect(file.data.status).toBe('READY' as FileStatus); const rs = await file.downloadContent(); const chunks: string[] = []; for await (const chunk of rs) { @@ -170,17 +170,17 @@ describe('FileService', () => { meta: { some: 'data' }, }; const updatedFile1 = await file.update(updatableFields); - expect(updatedFile1.meta).toEqual(expect.objectContaining(updatableFields.meta)); - expect(updatedFile1.name).toBe(updatableFields.name); - expect(updatedFile1.alt).toBe(updatableFields.alt); + expect(updatedFile1.data.meta).toEqual(expect.objectContaining(updatableFields.meta)); + expect(updatedFile1.data.name).toBe(updatableFields.name); + expect(updatedFile1.data.alt).toBe(updatableFields.alt); // Fetch the file anew to be doubly sure const updatedFile2 = await fileService.getById({ fileKind, id: file.id }); - expect(updatedFile2.meta).toEqual(expect.objectContaining(updatableFields.meta)); + expect(updatedFile2.data.meta).toEqual(expect.objectContaining(updatableFields.meta)); // Below also tests that our meta type is work as expected by using `some` field. - expect(updatedFile2.meta?.some).toBe(updatableFields.meta.some); - expect(updatedFile2.name).toBe(updatableFields.name); - expect(updatedFile2.alt).toBe(updatableFields.alt); + expect(updatedFile2.data.meta?.some).toBe(updatableFields.meta.some); + expect(updatedFile2.data.name).toBe(updatableFields.name); + expect(updatedFile2.data.alt).toBe(updatableFields.alt); }); it('enforces max size settings', async () => { @@ -339,7 +339,7 @@ describe('FileService', () => { action: 'delete', outcome: 'success', }, - message: expect.stringContaining('Removed share for "myfile"'), + message: expect.stringContaining('Removed share with'), }); }); }); diff --git a/x-pack/plugins/files/server/routes/common.test.ts b/x-pack/plugins/files/server/routes/common.test.ts index cda57b5b6bf13..cc22b0d8afb01 100644 --- a/x-pack/plugins/files/server/routes/common.test.ts +++ b/x-pack/plugins/files/server/routes/common.test.ts @@ -16,7 +16,7 @@ describe('getDownloadHeadersForFile', () => { }; } - const file = { name: 'test', mimeType: undefined } as unknown as File; + const file = { data: { name: 'test', mimeType: undefined } } as unknown as File; test('no mime type and name from file object', () => { expect(getDownloadHeadersForFile(file, undefined)).toEqual( t({ ct: 'application/octet-stream', cd: 'test' }) @@ -34,13 +34,13 @@ describe('getDownloadHeadersForFile', () => { ); }); test('mime type and no name', () => { - const fileWithMime = { ...file, mimeType: 'application/pdf' } as File; + const fileWithMime = { data: { ...file.data, mimeType: 'application/pdf' } } as File; expect(getDownloadHeadersForFile(fileWithMime, undefined)).toEqual( t({ ct: 'application/pdf', cd: 'test' }) ); }); test('mime type and name', () => { - const fileWithMime = { ...file, mimeType: 'application/pdf' } as File; + const fileWithMime = { data: { ...file.data, mimeType: 'application/pdf' } } as File; expect(getDownloadHeadersForFile(fileWithMime, 'a cool file.pdf')).toEqual( t({ ct: 'application/pdf', cd: 'a cool file.pdf' }) ); diff --git a/x-pack/plugins/files/server/routes/common.ts b/x-pack/plugins/files/server/routes/common.ts index 23f702493c92d..f8a3a1965267b 100644 --- a/x-pack/plugins/files/server/routes/common.ts +++ b/x-pack/plugins/files/server/routes/common.ts @@ -11,7 +11,7 @@ import type { File } from '../../common/types'; export function getDownloadHeadersForFile(file: File, fileName?: string): ResponseHeaders { return { 'content-type': - (fileName && mime.getType(fileName)) ?? file.mimeType ?? 'application/octet-stream', + (fileName && mime.getType(fileName)) ?? file.data.mimeType ?? 'application/octet-stream', // Note, this name can be overridden by the client if set via a "download" attribute on the HTML tag. 'content-disposition': `attachment; filename="${fileName || getDownloadedFileName(file)}"`, }; @@ -20,8 +20,8 @@ export function getDownloadHeadersForFile(file: File, fileName?: string): Respon export function getDownloadedFileName(file: File): string { // When creating a file we also calculate the extension so the `file.extension` // check is not really necessary except for type checking. - if (file.mimeType && file.extension) { - return `${file.name}.${file.extension}`; + if (file.data.mimeType && file.data.extension) { + return `${file.data.name}.${file.data.extension}`; } - return file.name; + return file.data.name; } diff --git a/x-pack/plugins/files/server/routes/file_kind/upload.ts b/x-pack/plugins/files/server/routes/file_kind/upload.ts index 7b3db76ad38ad..dc6e8e7f4b268 100644 --- a/x-pack/plugins/files/server/routes/file_kind/upload.ts +++ b/x-pack/plugins/files/server/routes/file_kind/upload.ts @@ -50,7 +50,7 @@ export const handler: FileKindsRequestHandler = async ( } throw e; } - const body: Response = { ok: true, size: file.size! }; + const body: Response = { ok: true, size: file.data.size! }; return res.ok({ body }); }; diff --git a/x-pack/plugins/fleet/common/constants/routes.ts b/x-pack/plugins/fleet/common/constants/routes.ts index d46a5f23ddf08..b415328a303d3 100644 --- a/x-pack/plugins/fleet/common/constants/routes.ts +++ b/x-pack/plugins/fleet/common/constants/routes.ts @@ -49,6 +49,7 @@ export const DATA_STREAM_API_ROUTES = { // Package policy API routes export const PACKAGE_POLICY_API_ROUTES = { LIST_PATTERN: `${PACKAGE_POLICY_API_ROOT}`, + BULK_GET_PATTERN: `${PACKAGE_POLICY_API_ROOT}/_bulk_get`, INFO_PATTERN: `${PACKAGE_POLICY_API_ROOT}/{packagePolicyId}`, CREATE_PATTERN: `${PACKAGE_POLICY_API_ROOT}`, UPDATE_PATTERN: `${PACKAGE_POLICY_API_ROOT}/{packagePolicyId}`, @@ -61,6 +62,7 @@ export const PACKAGE_POLICY_API_ROUTES = { // Agent policy API routes export const AGENT_POLICY_API_ROUTES = { LIST_PATTERN: `${AGENT_POLICY_API_ROOT}`, + BULK_GET_PATTERN: `${AGENT_POLICY_API_ROOT}/_bulk_get`, INFO_PATTERN: `${AGENT_POLICY_API_ROOT}/{agentPolicyId}`, CREATE_PATTERN: `${AGENT_POLICY_API_ROOT}`, UPDATE_PATTERN: `${AGENT_POLICY_API_ROOT}/{agentPolicyId}`, diff --git a/x-pack/plugins/fleet/common/openapi/bundled.json b/x-pack/plugins/fleet/common/openapi/bundled.json index f7d5054f53224..adb49b25782cd 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.json +++ b/x-pack/plugins/fleet/common/openapi/bundled.json @@ -2215,6 +2215,66 @@ } } }, + "/agent_policies/_bulk_get": { + "post": { + "summary": "Agent policies - Bulk Get", + "tags": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "list of agent policy ids" + }, + "full": { + "type": "boolean", + "description": "get full policies with package policies populated" + }, + "ignoreMissing": { + "type": "boolean" + } + }, + "required": [ + "ids" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/agent_policy" + } + } + }, + "required": [ + "items" + ] + } + } + } + } + }, + "operationId": "bulk-get-agent-policies", + "security": [], + "parameters": [] + } + }, "/agent_policies/delete": { "post": { "summary": "Agent policy - Delete", @@ -2706,6 +2766,62 @@ ] } }, + "/package_policies/_bulk_get": { + "post": { + "summary": "Package policies - Bulk Get", + "tags": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "list of package policy ids" + }, + "ignoreMissing": { + "type": "boolean" + } + }, + "required": [ + "ids" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/package_policy" + } + } + }, + "required": [ + "items" + ] + } + } + } + } + }, + "operationId": "bulk-get-package-policies", + "security": [], + "parameters": [] + } + }, "/package_policies/delete": { "post": { "summary": "Package policy - Delete", diff --git a/x-pack/plugins/fleet/common/openapi/bundled.yaml b/x-pack/plugins/fleet/common/openapi/bundled.yaml index 60827666ca5e8..3cc16afc3f410 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.yaml +++ b/x-pack/plugins/fleet/common/openapi/bundled.yaml @@ -1355,6 +1355,45 @@ paths: required: - name description: '' + /agent_policies/_bulk_get: + post: + summary: Agent policies - Bulk Get + tags: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + description: list of agent policy ids + full: + type: boolean + description: get full policies with package policies populated + ignoreMissing: + type: boolean + required: + - ids + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/agent_policy' + required: + - items + operationId: bulk-get-agent-policies + security: [] + parameters: [] /agent_policies/delete: post: summary: Agent policy - Delete @@ -1662,6 +1701,42 @@ paths: type: boolean parameters: - $ref: '#/components/parameters/kbn_xsrf' + /package_policies/_bulk_get: + post: + summary: Package policies - Bulk Get + tags: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + description: list of package policy ids + ignoreMissing: + type: boolean + required: + - ids + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/package_policy' + required: + - items + operationId: bulk-get-package-policies + security: [] + parameters: [] /package_policies/delete: post: summary: Package policy - Delete diff --git a/x-pack/plugins/fleet/common/openapi/entrypoint.yaml b/x-pack/plugins/fleet/common/openapi/entrypoint.yaml index 316ffa6e5679a..2756656e189f2 100644 --- a/x-pack/plugins/fleet/common/openapi/entrypoint.yaml +++ b/x-pack/plugins/fleet/common/openapi/entrypoint.yaml @@ -82,6 +82,8 @@ paths: $ref: 'paths/agent_policies@{agent_policy_id}.yaml' '/agent_policies/{agentPolicyId}/copy': $ref: 'paths/agent_policies@{agent_policy_id}@copy.yaml' + /agent_policies/_bulk_get: + $ref: paths/agent_policies@_bulk_get.yaml /agent_policies/delete: $ref: paths/agent_policies@delete.yaml # Data streams endpoints @@ -99,6 +101,8 @@ paths: # Package policies endpoints /package_policies: $ref: paths/package_policies.yaml + /package_policies/_bulk_get: + $ref: paths/package_policies@_bulk_get.yaml /package_policies/delete: $ref: paths/package_policies@delete.yaml /package_policies/upgrade: diff --git a/x-pack/plugins/fleet/common/openapi/paths/agent_policies@_bulk_get.yaml b/x-pack/plugins/fleet/common/openapi/paths/agent_policies@_bulk_get.yaml new file mode 100644 index 0000000000000..0ac58fffba167 --- /dev/null +++ b/x-pack/plugins/fleet/common/openapi/paths/agent_policies@_bulk_get.yaml @@ -0,0 +1,38 @@ +post: + summary: Agent policies - Bulk Get + tags: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + description: list of agent policy ids + full: + type: boolean + description: get full policies with package policies populated + ignoreMissing: + type: boolean + required: + - ids + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: ../components/schemas/agent_policy.yaml + required: + - items + operationId: bulk-get-agent-policies + security: [] + parameters: [] diff --git a/x-pack/plugins/fleet/common/openapi/paths/package_policies@_bulk_get.yaml b/x-pack/plugins/fleet/common/openapi/paths/package_policies@_bulk_get.yaml new file mode 100644 index 0000000000000..70d54b12e47eb --- /dev/null +++ b/x-pack/plugins/fleet/common/openapi/paths/package_policies@_bulk_get.yaml @@ -0,0 +1,35 @@ +post: + summary: Package policies - Bulk Get + tags: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + description: list of package policy ids + ignoreMissing: + type: boolean + required: + - ids + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: ../components/schemas/package_policy.yaml + required: + - items + operationId: bulk-get-package-policies + security: [] + parameters: [] diff --git a/x-pack/plugins/fleet/common/services/agent_status.ts b/x-pack/plugins/fleet/common/services/agent_status.ts index 59ec2b9babd70..7dbfb88192da8 100644 --- a/x-pack/plugins/fleet/common/services/agent_status.ts +++ b/x-pack/plugins/fleet/common/services/agent_status.ts @@ -6,11 +6,11 @@ */ import { AGENT_POLLING_THRESHOLD_MS } from '../constants'; -import type { Agent, AgentStatus } from '../types'; +import type { Agent, AgentStatus, FleetServerAgent } from '../types'; const offlineTimeoutIntervalCount = 10; // 30s*10 = 5m timeout -export function getAgentStatus(agent: Agent): AgentStatus { +export function getAgentStatus(agent: Agent | FleetServerAgent): AgentStatus { const { last_checkin: lastCheckIn } = agent; if (!agent.active) { @@ -33,7 +33,15 @@ export function getAgentStatus(agent: Agent): AgentStatus { if (agent.last_checkin_status === 'degraded') { return 'degraded'; } - if (agent.upgrade_started_at && !agent.upgraded_at) { + + const policyRevision = + 'policy_revision' in agent + ? agent.policy_revision + : 'policy_revision_idx' in agent + ? agent.policy_revision_idx + : undefined; + + if (!policyRevision || (agent.upgrade_started_at && !agent.upgraded_at)) { return 'updating'; } if (intervalsSinceLastCheckIn >= offlineTimeoutIntervalCount) { @@ -76,7 +84,7 @@ export function buildKueryForUpgradingAgents(path: string = '') { export function buildKueryForUpdatingAgents(path: string = '') { return `(${buildKueryForUpgradingAgents(path)}) or (${buildKueryForEnrollingAgents( path - )}) or (${buildKueryForUnenrollingAgents(path)})`; + )}) or (${buildKueryForUnenrollingAgents(path)}) or (not ${path}policy_revision_idx:*)`; } export function buildKueryForInactiveAgents(path: string = '') { diff --git a/x-pack/plugins/fleet/common/types/rest_spec/agent_policy.ts b/x-pack/plugins/fleet/common/types/rest_spec/agent_policy.ts index d53da769c754b..a62b1a1b9e4e6 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/agent_policy.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/agent_policy.ts @@ -7,7 +7,7 @@ import type { AgentPolicy, NewAgentPolicy, FullAgentPolicy } from '../models'; -import type { ListResult, ListWithKuery } from './common'; +import type { ListResult, ListWithKuery, BulkGetResult } from './common'; export interface GetAgentPoliciesRequest { query: ListWithKuery & { @@ -17,6 +17,7 @@ export interface GetAgentPoliciesRequest { export type GetAgentPoliciesResponseItem = AgentPolicy & { agents?: number }; +export type BulkGetAgentPoliciesResponse = BulkGetResult; export type GetAgentPoliciesResponse = ListResult; export interface GetOneAgentPolicyRequest { diff --git a/x-pack/plugins/fleet/common/types/rest_spec/common.ts b/x-pack/plugins/fleet/common/types/rest_spec/common.ts index 7a0390d830de3..07bd3c7019c16 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/common.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/common.ts @@ -21,3 +21,7 @@ export interface ListResult { page: number; perPage: number; } + +export interface BulkGetResult { + items: T[]; +} diff --git a/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts b/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts index 260c8ebc8142f..c7de1bd489b47 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts @@ -14,13 +14,14 @@ import type { FullAgentPolicyInput, } from '../models'; -import type { ListResult, ListWithKuery } from './common'; +import type { BulkGetResult, ListResult, ListWithKuery } from './common'; export interface GetPackagePoliciesRequest { query: ListWithKuery; } export type GetPackagePoliciesResponse = ListResult; +export type BulkGetPackagePoliciesResponse = BulkGetResult; export interface GetOnePackagePolicyRequest { params: { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx index 77734feb67e21..1662f6d0c7214 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx @@ -132,7 +132,7 @@ export const PackagePolicyInputStreamConfig: React.FunctionComponent<{ - + {packageInputStream.description} ) : null} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_var_field.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_var_field.tsx index 327037a6f2745..812d5fc2233de 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_var_field.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_var_field.tsx @@ -155,7 +155,7 @@ export const PackagePolicyInputVarField: React.FunctionComponent<{ ) : null } - helpText={} + helpText={description && } > {field} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx index b87b09c7f58c4..f3023e718eacf 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx @@ -69,7 +69,7 @@ export const AgentDetailsOverviewSection: React.FunctionComponent<{ defaultMessage: 'Agent policy', }), description: agentPolicy ? ( - + ) : ( agent.policy_id || '-' ), diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx index 471c26f89123d..a9e3429732b3c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx @@ -449,7 +449,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { return ( - {agentPolicy && } + {agentPolicy && } {showWarning && ( diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/agent_policy_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/agent_policy_debugger.tsx index 71ee096f1e4fa..78be94ef07048 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/agent_policy_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/agent_policy_debugger.tsx @@ -16,7 +16,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; @@ -52,7 +52,7 @@ export const AgentPolicyDebugger: React.FunctionComponent = () => { // TODO: Depending on the number of agent policies, this might need to be switched to // `useInfinite` query with an infinite scrolling approach in the dropdown options. - const { data, status } = useQuery('debug-agent-policies', fetchAgentPolicies); + const { data, status } = useQuery(['debug-agent-policies'], fetchAgentPolicies); const agentPolicies = data?.data?.items ?? []; const comboBoxOptions = agentPolicies.map((policy) => ({ @@ -68,7 +68,7 @@ export const AgentPolicyDebugger: React.FunctionComponent = () => { const onDelete = () => { setSelectedPolicyId(undefined); - queryClient.invalidateQueries('debug-agent-policies'); + queryClient.invalidateQueries(['debug-agent-policies']); }; if (status === 'error') { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/fleet_index_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/fleet_index_debugger.tsx index 7c0c81858414a..3f678d4463480 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/fleet_index_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/fleet_index_debugger.tsx @@ -15,7 +15,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx index 7140a582980cf..9c3fa21c752f8 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx @@ -20,7 +20,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { useMutation, useQuery } from 'react-query'; +import { useMutation, useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -58,7 +58,7 @@ export const IntegrationDebugger: React.FunctionComponent = () => { const [isReinstallModalVisible, setIsReinstallModalVisible] = useState(false); const [isUninstallModalVisible, setIsUninstallModalVisible] = useState(false); - const integrations = useQuery('debug-integrations', fetchInstalledIntegrations); + const integrations = useQuery(['debug-integrations'], fetchInstalledIntegrations); const uninstallMutation = useMutation(async (integration: PackageListItem) => { const response = await sendRemovePackage(integration.name, integration.version, true); @@ -86,7 +86,7 @@ export const IntegrationDebugger: React.FunctionComponent = () => { setSelectedIntegrationId(undefined); setIsUninstallModalVisible(false); - queryClient.invalidateQueries('debug-integrations'); + queryClient.invalidateQueries(['debug-integrations']); return response.data; }); @@ -132,7 +132,7 @@ export const IntegrationDebugger: React.FunctionComponent = () => { setSelectedIntegrationId(undefined); setIsReinstallModalVisible(false); - queryClient.invalidateQueries('debug-integrations'); + queryClient.invalidateQueries(['debug-integrations']); return installResponse.data; }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/orphaned_integration_policy_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/orphaned_integration_policy_debugger.tsx index abc84ad425900..3febbe36c56f7 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/orphaned_integration_policy_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/orphaned_integration_policy_debugger.tsx @@ -15,7 +15,7 @@ import { EuiButton, EuiConfirmModal, } from '@elastic/eui'; -import { useMutation, useQuery } from 'react-query'; +import { useMutation, useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -46,7 +46,7 @@ export const OrphanedIntegrationPolicyDebugger: React.FunctionComponent = () => const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false); const [isDeleteAllModalVisible, setIsDeleteAllModalVisible] = useState(false); - const { data: orphanedPolicies } = useQuery('debug-orphaned-policies', fetchOrphanedPolicies); + const { data: orphanedPolicies } = useQuery(['debug-orphaned-policies'], fetchOrphanedPolicies); const comboBoxOptions = orphanedPolicies?.map((policy: { id: string; name: string }) => ({ @@ -83,7 +83,7 @@ export const OrphanedIntegrationPolicyDebugger: React.FunctionComponent = () => defaultMessage: 'Successfully deleted orphaned policy', }) ); - queryClient.invalidateQueries('debug-orphaned-policies'); + queryClient.invalidateQueries(['debug-orphaned-policies']); setSelectedPolicyId(undefined); setIsDeleteModalVisible(false); @@ -112,7 +112,7 @@ export const OrphanedIntegrationPolicyDebugger: React.FunctionComponent = () => defaultMessage: 'Successfully deleted all orphaned policies', }) ); - queryClient.invalidateQueries('debug-orphaned-policies'); + queryClient.invalidateQueries(['debug-orphaned-policies']); setSelectedPolicyId(undefined); setIsDeleteAllModalVisible(false); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/preconfiguration_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/preconfiguration_debugger.tsx index 35e9bcba75492..8184242f99e8d 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/preconfiguration_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/preconfiguration_debugger.tsx @@ -17,7 +17,7 @@ import { EuiLink, EuiConfirmModal, } from '@elastic/eui'; -import { useMutation, useQuery } from 'react-query'; +import { useMutation, useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -55,7 +55,7 @@ export const PreconfigurationDebugger: React.FunctionComponent = () => { const [isResetAllModalVisible, setIsResetAllModalVisible] = useState(false); const preconfiguredPolicies = useQuery( - 'debug-preconfigured-policies', + ['debug-preconfigured-policies'], fetchPreconfiguredPolicies ); @@ -91,7 +91,7 @@ export const PreconfigurationDebugger: React.FunctionComponent = () => { defaultMessage: 'Successfully reset policy', }) ); - queryClient.invalidateQueries('debug-preconfigured-policies'); + queryClient.invalidateQueries(['debug-preconfigured-policies']); setSelectedPolicyId(undefined); setIsResetModalVisible(false); @@ -116,7 +116,7 @@ export const PreconfigurationDebugger: React.FunctionComponent = () => { defaultMessage: 'Successfully reset policies', }) ); - queryClient.invalidateQueries('debug-preconfigured-policies'); + queryClient.invalidateQueries(['debug-preconfigured-policies']); setSelectedPolicyId(undefined); setIsResetAllModalVisible(false); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_debugger.tsx index c23b383d96f9d..de95b08a4dfb6 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_debugger.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useRef } from 'react'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_names_combo.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_names_combo.tsx index 9458bca298b9a..aa9d7cb011e83 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_names_combo.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_names_combo.tsx @@ -6,7 +6,7 @@ */ import React, { forwardRef, useImperativeHandle } from 'react'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { EuiComboBox } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/index.tsx index b54a97d3b270c..89c61a78eb61c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/index.tsx @@ -18,8 +18,8 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; -import { QueryClient, QueryClientProvider } from 'react-query'; -import { ReactQueryDevtools } from 'react-query/devtools'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/components/header/header_portal.tsx b/x-pack/plugins/fleet/public/applications/integrations/components/header/header_portal.tsx index 190a6e1ba49c7..8b0671f0a9a45 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/components/header/header_portal.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/components/header/header_portal.tsx @@ -8,7 +8,7 @@ import type { AppMountParameters } from '@kbn/core/public'; import type { FC } from 'react'; import React, { useEffect, useMemo } from 'react'; -import { createPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; +import { createHtmlPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; @@ -18,7 +18,7 @@ export interface Props { } export const HeaderPortal: FC = ({ children, setHeaderActionMenu, theme$ }) => { - const portalNode = useMemo(() => createPortalNode(), []); + const portalNode = useMemo(() => createHtmlPortalNode(), []); useEffect(() => { setHeaderActionMenu((element) => { diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/markdown_renderers.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/markdown_renderers.tsx index 2cbdfe3671c4e..8734d051e0be7 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/markdown_renderers.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/markdown_renderers.tsx @@ -11,9 +11,9 @@ import { EuiTableHeaderCell, EuiTableRow, EuiTableRowCell, - EuiText, } from '@elastic/eui'; import React from 'react'; +import type { TransformOptions } from 'react-markdown'; /** prevents links to the new pages from accessing `window.opener` */ const REL_NOOPENER = 'noopener'; @@ -30,42 +30,25 @@ const CODE_LANGUAGE_OVERRIDES: Record = { $yml: 'yml', }; -export const markdownRenderers = { - root: ({ children }: { children: React.ReactNode[] }) => ( - {children} - ), - table: ({ children }: { children: React.ReactNode[] }) => ( - {children}
- ), - tableRow: ({ children }: { children: React.ReactNode[] }) => ( - {children} - ), - tableCell: ({ isHeader, children }: { isHeader: boolean; children: React.ReactNode[] }) => { - return isHeader ? ( - {children} - ) : ( - {children} - ); - }, +export const markdownRenderers: TransformOptions['components'] = { + table: ({ children }) => {children}
, + tr: ({ children }) => {children}, + th: ({ children }) => {children}, + td: ({ children }) => {children}, // the headings used in markdown don't match our page so mapping them to the appropriate one - heading: ({ level, children }: { level: number; children: React.ReactNode[] }) => { - switch (level) { - case 1: - return

{children}

; - case 2: - return

{children}

; - case 3: - return
{children}
; - default: - return
{children}
; - } - }, + h1: ({ children }) =>

{children}

, + h2: ({ children }) =>

{children}

, + h3: ({ children }) =>
{children}
, + h4: ({ children }) =>
{children}
, + h5: ({ children }) =>
{children}
, + h6: ({ children }) =>
{children}
, link: ({ children, href }: { children: React.ReactNode[]; href?: string }) => ( {children} ), - code: ({ language, value }: { language: string; value: string }) => { + // @ts-expect-error update types + code: ({ language, value }) => { let parsedLang = language; // Some integrations export code block content that includes language tags that have since diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/readme.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/readme.tsx index 240b3c7bf7442..f7e9c2a5b4e8f 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/readme.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/readme.tsx @@ -43,11 +43,11 @@ export function Readme({ return ( {markdown !== undefined ? ( - + + + {markdown} + + ) : ( {/* simulates a long page of text loading */} diff --git a/x-pack/plugins/fleet/public/components/link_and_revision.test.tsx b/x-pack/plugins/fleet/public/components/link_and_revision.test.tsx new file mode 100644 index 0000000000000..f2d0a8970cfa3 --- /dev/null +++ b/x-pack/plugins/fleet/public/components/link_and_revision.test.tsx @@ -0,0 +1,51 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import type { TestRenderer } from '../mock'; +import { createFleetTestRendererMock } from '../mock'; + +import type { AgentPolicy, Agent } from '../types'; + +import { AgentPolicySummaryLine } from './link_and_revision'; + +jest.mock('../hooks/use_fleet_status', () => ({ + FleetStatusProvider: (props: any) => { + return props.children; + }, + useFleetStatus: jest.fn().mockReturnValue({}), +})); + +describe('AgentPolicySummaryLine', () => { + let testRenderer: TestRenderer; + + const render = (agentPolicy: AgentPolicy, agent?: Agent) => + testRenderer.render(); + + beforeEach(() => { + testRenderer = createFleetTestRendererMock(); + }); + + test('it should render policy and revision if no agent is provided', async () => { + const results = render({ name: 'test', revision: 2 } as AgentPolicy); + expect(results.container.textContent).toBe('testrev. 2'); + }); + + test('it should render policy without revision if the agent do not have revision', async () => { + const results = render({ name: 'test', revision: 1 } as AgentPolicy, {} as Agent); + expect(results.container.textContent).toBe('test'); + }); + + test('it should render policy with agent revision if an agent is provided', async () => { + const results = render( + { name: 'test', revision: 2 } as AgentPolicy, + { policy_revision: 1 } as Agent + ); + expect(results.container.textContent).toBe('testrev. 1'); + }); +}); diff --git a/x-pack/plugins/fleet/public/components/link_and_revision.tsx b/x-pack/plugins/fleet/public/components/link_and_revision.tsx index b56787fbb399c..64d4fa043e160 100644 --- a/x-pack/plugins/fleet/public/components/link_and_revision.tsx +++ b/x-pack/plugins/fleet/public/components/link_and_revision.tsx @@ -11,49 +11,54 @@ import { FormattedMessage } from '@kbn/i18n-react'; import type { CSSProperties } from 'react'; import React, { memo } from 'react'; -import type { AgentPolicy } from '../../common/types'; +import type { AgentPolicy, Agent } from '../../common/types'; import { useLink } from '../hooks'; const MIN_WIDTH: CSSProperties = { minWidth: 0 }; const NO_WRAP_WHITE_SPACE: CSSProperties = { whiteSpace: 'nowrap' }; -export const AgentPolicySummaryLine = memo<{ policy: AgentPolicy }>(({ policy }) => { - const { getHref } = useLink(); - const { name, id, revision, is_managed: isManaged } = policy; - return ( - - - - {name || id} - - - {isManaged && ( - - )} - {revision && ( - - - - +export const AgentPolicySummaryLine = memo<{ policy: AgentPolicy; agent?: Agent }>( + ({ policy, agent }) => { + const { getHref } = useLink(); + const { name, id, is_managed: isManaged } = policy; + + const revision = agent ? agent.policy_revision : policy.revision; + + return ( + + + + {name || id} + - )} - - ); -}); + {isManaged && ( + + )} + {revision && ( + + + + + + )} + + ); + } +); diff --git a/x-pack/plugins/fleet/server/errors/index.ts b/x-pack/plugins/fleet/server/errors/index.ts index d0aca78fce5ef..713804d8a36f7 100644 --- a/x-pack/plugins/fleet/server/errors/index.ts +++ b/x-pack/plugins/fleet/server/errors/index.ts @@ -54,6 +54,7 @@ export class ConcurrentInstallOperationError extends IngestManagerError {} export class AgentReassignmentError extends IngestManagerError {} export class PackagePolicyIneligibleForUpgradeError extends IngestManagerError {} export class PackagePolicyValidationError extends IngestManagerError {} +export class PackagePolicyNotFoundError extends IngestManagerError {} export class BundledPackageNotFoundError extends IngestManagerError {} export class HostedAgentPolicyRestrictionRelatedError extends IngestManagerError { constructor(message = 'Cannot perform that action') { diff --git a/x-pack/plugins/fleet/server/integration_tests/helpers/docker_registry_helper.ts b/x-pack/plugins/fleet/server/integration_tests/helpers/docker_registry_helper.ts index 6862006c9ce49..35c698675e7c9 100644 --- a/x-pack/plugins/fleet/server/integration_tests/helpers/docker_registry_helper.ts +++ b/x-pack/plugins/fleet/server/integration_tests/helpers/docker_registry_helper.ts @@ -18,7 +18,7 @@ import pRetry from 'p-retry'; const BEFORE_SETUP_TIMEOUT = 30 * 60 * 1000; // 30 minutes; const DOCKER_START_TIMEOUT = 5 * 60 * 1000; // 5 minutes -const DOCKER_IMAGE = `docker.elastic.co/package-registry/distribution:d32582b3bbeef5283e4450a9403f26c2a5e415f4`; +const DOCKER_IMAGE = `docker.elastic.co/package-registry/distribution:production-v2-experimental`; function firstWithTimeout(source$: Rx.Observable, errorMsg: string, ms = 30 * 1000) { return Rx.race( diff --git a/x-pack/plugins/fleet/server/integration_tests/validate_bundled_packages.test.ts b/x-pack/plugins/fleet/server/integration_tests/validate_bundled_packages.test.ts index 14aa61ef21137..79388d7d5b914 100644 --- a/x-pack/plugins/fleet/server/integration_tests/validate_bundled_packages.test.ts +++ b/x-pack/plugins/fleet/server/integration_tests/validate_bundled_packages.test.ts @@ -19,8 +19,7 @@ import { appContextService } from '../services'; import { useDockerRegistry } from './helpers'; -// Failing: https://github.com/elastic/kibana/issues/138905 -describe.skip('validate bundled packages', () => { +describe('validate bundled packages', () => { const registryUrl = useDockerRegistry(); let mockContract: ReturnType; @@ -38,23 +37,32 @@ describe.skip('validate bundled packages', () => { } async function setupPackageObjects() { + // APM is a special case package in that it's "bundled release" is not available + // on the v2 registry image, because v2 currently only contains production packages. + // We bundle APM from snapshot, but that bundled version isn't available in the docker + // image that's running EPR during FTR runs, so to avoid nasty test failures we don't + // verify APM here. + const EXCLUDED_PACKAGES = ['apm']; + const bundledPackages = await getBundledPackageEntries(); const packageObjects = await Promise.all( - bundledPackages.map(async (bundledPackage) => { - const registryPackage = await Registry.getRegistryPackage( - bundledPackage.name, - bundledPackage.version - ); - - const packageArchive = await Registry.fetchArchiveBuffer({ - pkgName: bundledPackage.name, - pkgVersion: bundledPackage.version, - shouldVerify: false, - }); - - return { registryPackage, packageArchive }; - }) + bundledPackages + .filter((pkg) => !EXCLUDED_PACKAGES.includes(pkg.name)) + .map(async (bundledPackage) => { + const registryPackage = await Registry.getRegistryPackage( + bundledPackage.name, + bundledPackage.version + ); + + const packageArchive = await Registry.fetchArchiveBuffer({ + pkgName: bundledPackage.name, + pkgVersion: bundledPackage.version, + shouldVerify: false, + }); + + return { registryPackage, packageArchive }; + }) ); return packageObjects; diff --git a/x-pack/plugins/fleet/server/routes/agent/upgrade_handler.test.ts b/x-pack/plugins/fleet/server/routes/agent/upgrade_handler.test.ts new file mode 100644 index 0000000000000..5eafcf1a94104 --- /dev/null +++ b/x-pack/plugins/fleet/server/routes/agent/upgrade_handler.test.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { checkKibanaVersion } from './upgrade_handler'; + +describe('upgrade handler', () => { + describe('checkKibanaVersion', () => { + it('should not throw if upgrade version is equal to kibana version', () => { + expect(() => checkKibanaVersion('8.4.0', '8.4.0')).not.toThrowError(); + }); + + it('should throw if upgrade version is higher than kibana version', () => { + expect(() => checkKibanaVersion('8.5.0', '8.4.0')).toThrowError( + 'cannot upgrade agent to 8.5.0 because it is higher than the installed kibana version 8.4.0' + ); + }); + + it('should not throw if upgrade version is equal to kibana version with snapshot', () => { + expect(() => checkKibanaVersion('8.4.0', '8.4.0-SNAPSHOT')).not.toThrowError(); + }); + }); +}); diff --git a/x-pack/plugins/fleet/server/routes/agent/upgrade_handler.ts b/x-pack/plugins/fleet/server/routes/agent/upgrade_handler.ts index 024158b5b8785..d75e3ad07d9b8 100644 --- a/x-pack/plugins/fleet/server/routes/agent/upgrade_handler.ts +++ b/x-pack/plugins/fleet/server/routes/agent/upgrade_handler.ts @@ -160,7 +160,7 @@ export const checkKibanaVersion = (version: string, kibanaVersion: string) => { if (!versionToUpgradeNumber) throw new Error(`version to upgrade ${versionToUpgradeNumber} is not valid`); - if (semverGt(version, kibanaVersion)) + if (semverGt(versionToUpgradeNumber, kibanaVersionNumber)) throw new Error( `cannot upgrade agent to ${versionToUpgradeNumber} because it is higher than the installed kibana version ${kibanaVersionNumber}` ); 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 0f632dfbb9cff..8235c3c3348b2 100644 --- a/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts @@ -6,7 +6,7 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import type { RequestHandler, ResponseHeaders } from '@kbn/core/server'; +import type { RequestHandler, ResponseHeaders, ElasticsearchClient } from '@kbn/core/server'; import pMap from 'p-map'; import { safeDump } from 'js-yaml'; @@ -24,6 +24,8 @@ import type { GetFullAgentPolicyRequestSchema, GetK8sManifestRequestSchema, FleetRequestHandler, + BulkGetAgentPoliciesRequestSchema, + AgentPolicy, } from '../../types'; import type { @@ -37,10 +39,28 @@ import type { GetFullAgentPolicyResponse, GetFullAgentConfigMapResponse, GetFullAgentManifestResponse, + BulkGetAgentPoliciesResponse, } from '../../../common/types'; -import { defaultIngestErrorHandler } from '../../errors'; +import { defaultIngestErrorHandler, AgentPolicyNotFoundError } from '../../errors'; import { createAgentPolicyWithPackages } from '../../services/agent_policy_create'; +async function populateAssignedAgentsCount( + esClient: ElasticsearchClient, + agentPolicies: AgentPolicy[] +) { + await pMap( + agentPolicies, + (agentPolicy: GetAgentPoliciesResponseItem) => + getAgentsByKuery(esClient, { + showInactive: false, + perPage: 0, + page: 1, + kuery: `${AGENTS_PREFIX}.policy_id:${agentPolicy.id}`, + }).then(({ total: agentTotal }) => (agentPolicy.agents = agentTotal)), + { concurrency: 10 } + ); +} + export const getAgentPoliciesHandler: FleetRequestHandler< undefined, TypeOf @@ -62,20 +82,45 @@ export const getAgentPoliciesHandler: FleetRequestHandler< perPage, }; - await pMap( + await populateAssignedAgentsCount(esClient, items); + + return response.ok({ body }); + } catch (error) { + return defaultIngestErrorHandler({ error, response }); + } +}; + +export const bulkGetAgentPoliciesHandler: FleetRequestHandler< + undefined, + undefined, + TypeOf +> = async (context, request, response) => { + const coreContext = await context.core; + const fleetContext = await context.fleet; + const soClient = fleetContext.epm.internalSoClient; + const esClient = coreContext.elasticsearch.client.asInternalUser; + const { full: withPackagePolicies = false, ignoreMissing = false, ids } = request.body; + try { + const items = await agentPolicyService.getByIDs(soClient, ids, { + withPackagePolicies, + ignoreMissing, + }); + const body: BulkGetAgentPoliciesResponse = { items, - (agentPolicy: GetAgentPoliciesResponseItem) => - getAgentsByKuery(esClient, { - showInactive: false, - perPage: 0, - page: 1, - kuery: `${AGENTS_PREFIX}.policy_id:${agentPolicy.id}`, - }).then(({ total: agentTotal }) => (agentPolicy.agents = agentTotal)), - { concurrency: 10 } - ); + }; + + await populateAssignedAgentsCount(esClient, items); return response.ok({ body }); } catch (error) { + if (error instanceof AgentPolicyNotFoundError) { + return response.notFound({ + body: { + message: error.message, + }, + }); + } + return defaultIngestErrorHandler({ error, response }); } }; diff --git a/x-pack/plugins/fleet/server/routes/agent_policy/index.ts b/x-pack/plugins/fleet/server/routes/agent_policy/index.ts index b42799d738d4c..938d8b3332b71 100644 --- a/x-pack/plugins/fleet/server/routes/agent_policy/index.ts +++ b/x-pack/plugins/fleet/server/routes/agent_policy/index.ts @@ -15,6 +15,7 @@ import { DeleteAgentPolicyRequestSchema, GetFullAgentPolicyRequestSchema, GetK8sManifestRequestSchema, + BulkGetAgentPoliciesRequestSchema, } from '../../types'; import type { FleetAuthzRouter } from '../security'; @@ -31,6 +32,7 @@ import { downloadFullAgentPolicy, downloadK8sManifest, getK8sManifest, + bulkGetAgentPoliciesHandler, } from './handlers'; export const registerRoutes = (router: FleetAuthzRouter) => { @@ -46,6 +48,18 @@ export const registerRoutes = (router: FleetAuthzRouter) => { getAgentPoliciesHandler ); + // Bulk GET + router.post( + { + path: AGENT_POLICY_API_ROUTES.BULK_GET_PATTERN, + validate: BulkGetAgentPoliciesRequestSchema, + fleetAuthz: { + fleet: { readAgentPolicies: true }, + }, + }, + bulkGetAgentPoliciesHandler + ); + // Get one router.get( { diff --git a/x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts b/x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts index 222408c6e0524..5e67857540143 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts @@ -138,8 +138,8 @@ describe('When calling package policy', () => { // Set the routeConfig and routeHandler to the Create API beforeEach(() => { - [routeConfig, routeHandler] = routerMock.post.mock.calls.find(([{ path }]) => - path.startsWith(PACKAGE_POLICY_API_ROUTES.CREATE_PATTERN) + [routeConfig, routeHandler] = routerMock.post.mock.calls.find( + ([{ path }]) => path === PACKAGE_POLICY_API_ROUTES.CREATE_PATTERN )!; }); diff --git a/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts b/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts index 8ecbd11ec5986..0b5f71910cfa9 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts @@ -25,8 +25,10 @@ import type { FleetRequestHandler, PackagePolicy, DeleteOnePackagePolicyRequestSchema, + BulkGetPackagePoliciesRequestSchema, } from '../../types'; import type { + BulkGetPackagePoliciesResponse, CreatePackagePolicyResponse, DeletePackagePoliciesResponse, NewPackagePolicy, @@ -34,7 +36,7 @@ import type { UpgradePackagePolicyResponse, } from '../../../common/types'; import { installationStatuses } from '../../../common/constants'; -import { defaultIngestErrorHandler } from '../../errors'; +import { defaultIngestErrorHandler, PackagePolicyNotFoundError } from '../../errors'; import { getInstallations } from '../../services/epm/packages'; import { PACKAGES_SAVED_OBJECT_TYPE, SO_SEARCH_LIMIT } from '../../constants'; @@ -61,6 +63,34 @@ export const getPackagePoliciesHandler: RequestHandler< } }; +export const bulkGetPackagePoliciesHandler: RequestHandler< + undefined, + undefined, + TypeOf +> = async (context, request, response) => { + const soClient = (await context.core).savedObjects.client; + const { ids, ignoreMissing } = request.body; + try { + const items = await packagePolicyService.getByIDs(soClient, ids, { + ignoreMissing, + }); + + const body: BulkGetPackagePoliciesResponse = { items: items ?? [] }; + + return response.ok({ + body, + }); + } catch (error) { + if (error instanceof PackagePolicyNotFoundError) { + return response.notFound({ + body: { message: error.message }, + }); + } + + return defaultIngestErrorHandler({ error, response }); + } +}; + export const getOnePackagePolicyHandler: RequestHandler< TypeOf > = async (context, request, response) => { diff --git a/x-pack/plugins/fleet/server/routes/package_policy/index.ts b/x-pack/plugins/fleet/server/routes/package_policy/index.ts index cf52b740245f8..004037623bb0d 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/index.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/index.ts @@ -15,6 +15,7 @@ import { UpgradePackagePoliciesRequestSchema, DryRunPackagePoliciesRequestSchema, DeleteOnePackagePolicyRequestSchema, + BulkGetPackagePoliciesRequestSchema, } from '../../types'; import type { FleetAuthzRouter } from '../security'; @@ -28,6 +29,7 @@ import { dryRunUpgradePackagePolicyHandler, getOrphanedPackagePolicies, deleteOnePackagePolicyHandler, + bulkGetPackagePoliciesHandler, } from './handlers'; export const registerRoutes = (router: FleetAuthzRouter) => { @@ -43,6 +45,17 @@ export const registerRoutes = (router: FleetAuthzRouter) => { getPackagePoliciesHandler ); + router.post( + { + path: PACKAGE_POLICY_API_ROUTES.BULK_GET_PATTERN, + validate: BulkGetPackagePoliciesRequestSchema, + fleetAuthz: { + integrations: { readIntegrationPolicies: true }, + }, + }, + bulkGetPackagePoliciesHandler + ); + // Get one router.get( { diff --git a/x-pack/plugins/fleet/server/services/agent_policy.ts b/x-pack/plugins/fleet/server/services/agent_policy.ts index 7eb59ade87f0b..4008100518984 100644 --- a/x-pack/plugins/fleet/server/services/agent_policy.ts +++ b/x-pack/plugins/fleet/server/services/agent_policy.ts @@ -53,7 +53,11 @@ import type { Output, DeletePackagePoliciesResponse, } from '../../common/types'; -import { AgentPolicyNameExistsError, HostedAgentPolicyRestrictionRelatedError } from '../errors'; +import { + AgentPolicyNameExistsError, + HostedAgentPolicyRestrictionRelatedError, + AgentPolicyNotFoundError, +} from '../errors'; import type { FullAgentConfigMap } from '../../common/types/models/agent_cm'; @@ -259,7 +263,10 @@ class AgentPolicyService { agentPolicy.package_policies = (await packagePolicyService.getByIDs( soClient, - (agentPolicySO.attributes.package_policies as string[]) || [] + (agentPolicySO.attributes.package_policies as string[]) || [], + { + ignoreMissing: true, + } )) || []; } @@ -269,16 +276,44 @@ class AgentPolicyService { public async getByIDs( soClient: SavedObjectsClientContract, ids: string[], - options: { fields?: string[] } = {} + options: { fields?: string[]; withPackagePolicies?: boolean; ignoreMissing?: boolean } = {} ): Promise { const objects = ids.map((id) => ({ ...options, id, type: SAVED_OBJECT_TYPE })); - const agentPolicySO = await soClient.bulkGet(objects); + const bulkGetResponse = await soClient.bulkGet(objects); - return agentPolicySO.saved_objects.map((so) => ({ - id: so.id, - version: so.version, - ...so.attributes, - })); + const agentPolicies = await pMap( + bulkGetResponse.saved_objects, + async (agentPolicySO) => { + if (agentPolicySO.error) { + if (options.ignoreMissing && agentPolicySO.error.statusCode === 404) { + return null; + } else if (agentPolicySO.error.statusCode === 404) { + throw new AgentPolicyNotFoundError(`Agent policy ${agentPolicySO.id} not found`); + } else { + throw new Error(agentPolicySO.error.message); + } + } + + const agentPolicy = { + id: agentPolicySO.id, + ...agentPolicySO.attributes, + }; + if (options.withPackagePolicies) { + const agentPolicyWithPackagePolicies = await this.get( + soClient, + agentPolicySO.id, + options.withPackagePolicies + ); + if (agentPolicyWithPackagePolicies) { + agentPolicy.package_policies = agentPolicyWithPackagePolicies.package_policies; + } + } + return agentPolicy; + }, + { concurrency: 50 } + ); + + return agentPolicies.filter((agentPolicy): agentPolicy is AgentPolicy => agentPolicy !== null); } public async list( diff --git a/x-pack/plugins/fleet/server/services/agents/hosted_agent.ts b/x-pack/plugins/fleet/server/services/agents/hosted_agent.ts index 0c26e09575ac3..4acba8551e86d 100644 --- a/x-pack/plugins/fleet/server/services/agents/hosted_agent.ts +++ b/x-pack/plugins/fleet/server/services/agents/hosted_agent.ts @@ -22,6 +22,7 @@ export async function getHostedPolicies( // get the agent policies for those ids const agentPolicies = await agentPolicyService.getByIDs(soClient, Array.from(policyIdsToGet), { fields: ['is_managed'], + ignoreMissing: true, }); const hostedPolicies = agentPolicies.reduce>((acc, policy) => { acc[policy.id] = policy.is_managed; diff --git a/x-pack/plugins/fleet/server/services/agents/status.test.ts b/x-pack/plugins/fleet/server/services/agents/status.test.ts index 8b30edeb5b5f8..7c598bf783c14 100644 --- a/x-pack/plugins/fleet/server/services/agents/status.test.ts +++ b/x-pack/plugins/fleet/server/services/agents/status.test.ts @@ -37,6 +37,7 @@ describe('Agent status service', () => { _id: 'id', _source: { active: true, + policy_revision_idx: 1, last_checkin: new Date().toISOString(), local_metadata: {}, user_provided_metadata: {}, @@ -92,6 +93,7 @@ describe('Agent status service', () => { _source: { active: true, last_checkin: new Date(Date.now() - 10 * AGENT_POLLING_THRESHOLD_MS - 1000).toISOString(), + policy_revision_idx: 2, local_metadata: {}, user_provided_metadata: {}, }, diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index ecdff37854b27..0e9c2fda047d1 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -54,6 +54,7 @@ import { PackagePolicyIneligibleForUpgradeError, PackagePolicyValidationError, PackagePolicyRestrictionRelatedError, + PackagePolicyNotFoundError, } from '../errors'; import { NewPackagePolicySchema, PackagePolicySchema, UpdatePackagePolicySchema } from '../types'; import type { @@ -293,7 +294,8 @@ class PackagePolicyService implements PackagePolicyServiceInterface { public async getByIDs( soClient: SavedObjectsClientContract, - ids: string[] + ids: string[], + options: { ignoreMissing?: boolean } = {} ): Promise { const packagePolicySO = await soClient.bulkGet( ids.map((id) => ({ @@ -305,11 +307,25 @@ class PackagePolicyService implements PackagePolicyServiceInterface { return null; } - return packagePolicySO.saved_objects.map((so) => ({ - id: so.id, - version: so.version, - ...so.attributes, - })); + return packagePolicySO.saved_objects + .map((so): PackagePolicy | null => { + if (so.error) { + if (options.ignoreMissing && so.error.statusCode === 404) { + return null; + } else if (so.error.statusCode === 404) { + throw new PackagePolicyNotFoundError(`Package policy ${so.id} not found`); + } else { + throw new Error(so.error.message); + } + } + + return { + id: so.id, + version: so.version, + ...so.attributes, + }; + }) + .filter((packagePolicy): packagePolicy is PackagePolicy => packagePolicy !== null); } public async list( @@ -1265,7 +1281,11 @@ export interface PackagePolicyServiceInterface { get(soClient: SavedObjectsClientContract, id: string): Promise; - getByIDs(soClient: SavedObjectsClientContract, ids: string[]): Promise; + getByIDs( + soClient: SavedObjectsClientContract, + ids: string[], + options?: { ignoreMissing?: boolean } + ): Promise; list( soClient: SavedObjectsClientContract, diff --git a/x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts b/x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts index 1f793445bf630..c2599d79b3364 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts @@ -9,7 +9,7 @@ import { schema } from '@kbn/config-schema'; import { NewAgentPolicySchema } from '../models'; -import { ListWithKuerySchema } from '.'; +import { ListWithKuerySchema, BulkRequestBodySchema } from './common'; export const GetAgentPoliciesRequestSchema = { query: ListWithKuerySchema.extends({ @@ -17,6 +17,12 @@ export const GetAgentPoliciesRequestSchema = { }), }; +export const BulkGetAgentPoliciesRequestSchema = { + body: BulkRequestBodySchema.extends({ + full: schema.maybe(schema.boolean()), + }), +}; + export const GetOneAgentPolicyRequestSchema = { params: schema.object({ agentPolicyId: schema.string(), diff --git a/x-pack/plugins/fleet/server/types/rest_spec/common.ts b/x-pack/plugins/fleet/server/types/rest_spec/common.ts index 2d12bd5d7c987..0c5f16ff87f90 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/common.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/common.ts @@ -22,4 +22,9 @@ export const ListWithKuerySchema = schema.object({ ), }); +export const BulkRequestBodySchema = schema.object({ + ids: schema.arrayOf(schema.string(), { minSize: 1 }), + ignoreMissing: schema.maybe(schema.boolean()), +}); + export type ListWithKuery = TypeOf; diff --git a/x-pack/plugins/fleet/server/types/rest_spec/package_policy.ts b/x-pack/plugins/fleet/server/types/rest_spec/package_policy.ts index b085060286d05..fa7cdce92400b 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/package_policy.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/package_policy.ts @@ -12,12 +12,16 @@ import { UpdatePackagePolicyRequestBodySchema, } from '../models'; -import { ListWithKuerySchema } from '.'; +import { ListWithKuerySchema, BulkRequestBodySchema } from './common'; export const GetPackagePoliciesRequestSchema = { query: ListWithKuerySchema, }; +export const BulkGetPackagePoliciesRequestSchema = { + body: BulkRequestBodySchema, +}; + export const GetOnePackagePolicyRequestSchema = { params: schema.object({ packagePolicyId: schema.string(), 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 c85c6f74b1641..e4d87d26cbecc 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 @@ -40,7 +40,9 @@ import './search_bar.scss'; const isMac = navigator.platform.toLowerCase().indexOf('mac') >= 0; -const blurEvent = new FocusEvent('blur'); +const blurEvent = new FocusEvent('focusout', { + bubbles: true, +}); const sortByScore = (a: GlobalSearchResult, b: GlobalSearchResult): number => { if (a.score < b.score) return 1; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx index d8c1fe071fe92..30355ea1a9a23 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import React, { useContext } from 'react'; +import React from 'react'; import { transparentize } from 'polished'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; @@ -17,7 +17,7 @@ import { LogEntryColumnWidths, } from './log_entry_column'; import { ASSUMED_SCROLLBAR_WIDTH } from './vertical_scroll_panel'; -import { LogPositionState } from '../../../containers/logs/log_position'; +import { useLogPositionStateContext } from '../../../containers/logs/log_position'; import { localizedDate } from '../../../../common/formatters/datetime'; import { LogColumnRenderConfiguration, @@ -30,7 +30,7 @@ export const LogColumnHeaders: React.FunctionComponent<{ columnConfigurations: LogColumnRenderConfiguration[]; columnWidths: LogEntryColumnWidths; }> = ({ columnConfigurations, columnWidths }) => { - const { firstVisiblePosition } = useContext(LogPositionState.Context); + const { firstVisiblePosition } = useLogPositionStateContext(); return ( {columnConfigurations.map((columnConfiguration) => { diff --git a/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts b/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts index 55b554560b743..70d72c25158da 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts +++ b/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts @@ -105,4 +105,5 @@ export const useLogFilterState = ({ indexPattern }: { indexPattern: DataViewBase }; }; -export const LogFilterState = createContainer(useLogFilterState); +export const [LogFilterStateProvider, useLogFilterStateContext] = + createContainer(useLogFilterState); diff --git a/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx b/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx index 5a62cb5e38677..2a5970721f5e5 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx @@ -6,13 +6,13 @@ */ import * as rt from 'io-ts'; -import React, { useContext } from 'react'; +import React from 'react'; import { Query } from '@kbn/es-query'; import { replaceStateKeyInQueryString, UrlStateContainer } from '../../../utils/url_state'; -import { LogFilterState } from './log_filter_state'; +import { useLogFilterStateContext } from './log_filter_state'; export const WithLogFilterUrlState: React.FC = () => { - const { filterQuery, applyLogFilterQuery } = useContext(LogFilterState.Context); + const { filterQuery, applyLogFilterQuery } = useLogFilterStateContext(); return ( { const [highlightTerms, setHighlightTerms] = useState([]); - const { visibleMidpoint, jumpToTargetPosition, startTimestamp, endTimestamp } = useContext( - LogPositionState.Context - ); + const { visibleMidpoint, jumpToTargetPosition, startTimestamp, endTimestamp } = + useLogPositionStateContext(); const throttledStartTimestamp = useThrottle(startTimestamp, FETCH_THROTTLE_INTERVAL); const throttledEndTimestamp = useThrottle(endTimestamp, FETCH_THROTTLE_INTERVAL); @@ -89,4 +88,5 @@ export const useLogHighlightsState = ({ }; }; -export const LogHighlightsState = createContainer(useLogHighlightsState); +export const [LogHighlightsStateProvider, useLogHighlightsStateContext] = + createContainer(useLogHighlightsState); diff --git a/x-pack/plugins/infra/public/containers/logs/log_position/log_position_state.ts b/x-pack/plugins/infra/public/containers/logs/log_position/log_position_state.ts index 59b7d00431459..521a5bf8562fc 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_position/log_position_state.ts +++ b/x-pack/plugins/infra/public/containers/logs/log_position/log_position_state.ts @@ -249,4 +249,5 @@ export const useLogPositionState: () => LogPositionStateParams & LogPositionCall return { ...state, ...callbacks }; }; -export const LogPositionState = createContainer(useLogPositionState); +export const [LogPositionStateProvider, useLogPositionStateContext] = + createContainer(useLogPositionState); diff --git a/x-pack/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx b/x-pack/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx index c0da683568f39..d4d8075a2598f 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx @@ -5,11 +5,11 @@ * 2.0. */ -import React, { useContext, useMemo } from 'react'; +import React, { useMemo } from 'react'; import { pickTimeKey } from '../../../../common/time'; import { replaceStateKeyInQueryString, UrlStateContainer } from '../../../utils/url_state'; -import { LogPositionState, LogPositionStateParams } from './log_position_state'; +import { useLogPositionStateContext, LogPositionStateParams } from './log_position_state'; import { isValidDatemath, datemathToEpochMillis } from '../../../utils/datemath'; /** @@ -35,7 +35,7 @@ export const WithLogPositionUrlState = () => { endDateExpression, updateDateRange, initialize, - } = useContext(LogPositionState.Context); + } = useLogPositionStateContext(); const urlState = useMemo( () => ({ position: visibleMidpoint ? pickTimeKey(visibleMidpoint) : null, diff --git a/x-pack/plugins/infra/public/containers/logs/log_summary/with_summary.ts b/x-pack/plugins/infra/public/containers/logs/log_summary/with_summary.ts index 1b6d9f850187a..e36ef1caa2c66 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_summary/with_summary.ts +++ b/x-pack/plugins/infra/public/containers/logs/log_summary/with_summary.ts @@ -5,12 +5,11 @@ * 2.0. */ -import { useContext } from 'react'; import useThrottle from 'react-use/lib/useThrottle'; import { useLogViewContext } from '../../../hooks/use_log_view'; import { RendererFunction } from '../../../utils/typed_react'; -import { LogFilterState } from '../log_filter'; -import { LogPositionState } from '../log_position'; +import { useLogFilterStateContext } from '../log_filter'; +import { useLogPositionStateContext } from '../log_position'; import { LogSummaryBuckets, useLogSummary } from './log_summary'; const FETCH_THROTTLE_INTERVAL = 3000; @@ -25,8 +24,8 @@ export const WithSummary = ({ }>; }) => { const { logViewId } = useLogViewContext(); - const { filterQuery } = useContext(LogFilterState.Context); - const { startTimestamp, endTimestamp } = useContext(LogPositionState.Context); + const { filterQuery } = useLogFilterStateContext(); + const { startTimestamp, endTimestamp } = useLogPositionStateContext(); // Keep it reasonably updated for the `now` case, but don't reload all the time when the user scrolls const throttledStartTimestamp = useThrottle(startTimestamp, FETCH_THROTTLE_INTERVAL); diff --git a/x-pack/plugins/infra/public/containers/logs/log_view_configuration.tsx b/x-pack/plugins/infra/public/containers/logs/log_view_configuration.tsx index 98672d6d14861..543cc61d78977 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_view_configuration.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_view_configuration.tsx @@ -26,7 +26,8 @@ export const useLogViewConfiguration = () => { }; }; -export const LogViewConfiguration = createContainer(useLogViewConfiguration); +export const [LogViewConfigurationProvider, useLogViewConfigurationContext] = + createContainer(useLogViewConfiguration); /** * constants diff --git a/x-pack/plugins/infra/public/containers/logs/view_log_in_context/view_log_in_context.ts b/x-pack/plugins/infra/public/containers/logs/view_log_in_context/view_log_in_context.ts index a389589488d92..b22a73d77cc54 100644 --- a/x-pack/plugins/infra/public/containers/logs/view_log_in_context/view_log_in_context.ts +++ b/x-pack/plugins/infra/public/containers/logs/view_log_in_context/view_log_in_context.ts @@ -42,4 +42,5 @@ export const useViewLogInContext = ( ]; }; -export const ViewLogInContext = createContainer(useViewLogInContext); +export const [ViewLogInContextProvider, useViewLogInProviderContext] = + createContainer(useViewLogInContext); diff --git a/x-pack/plugins/infra/public/containers/logs/with_log_textview.tsx b/x-pack/plugins/infra/public/containers/logs/with_log_textview.tsx index c981a113bf2f4..f57368709467d 100644 --- a/x-pack/plugins/infra/public/containers/logs/with_log_textview.tsx +++ b/x-pack/plugins/infra/public/containers/logs/with_log_textview.tsx @@ -5,10 +5,14 @@ * 2.0. */ -import React, { useContext, useMemo } from 'react'; +import React, { useMemo } from 'react'; import { UrlStateContainer } from '../../utils/url_state'; -import { availableTextScales, LogViewConfiguration, TextScale } from './log_view_configuration'; +import { + availableTextScales, + useLogViewConfigurationContext, + TextScale, +} from './log_view_configuration'; interface LogTextviewUrlState { textScale?: TextScale; @@ -16,9 +20,7 @@ interface LogTextviewUrlState { } export const WithLogTextviewUrlState = () => { - const { textScale, textWrap, setTextScale, setTextWrap } = useContext( - LogViewConfiguration.Context - ); + const { textScale, textWrap, setTextScale, setTextWrap } = useLogViewConfigurationContext(); const urlState = useMemo(() => ({ textScale, wrap: textWrap }), [textScale, textWrap]); diff --git a/x-pack/plugins/infra/public/containers/metrics_explorer/with_metrics_explorer_options_url_state.tsx b/x-pack/plugins/infra/public/containers/metrics_explorer/with_metrics_explorer_options_url_state.tsx index e66191923e39a..b192bf54e4829 100644 --- a/x-pack/plugins/infra/public/containers/metrics_explorer/with_metrics_explorer_options_url_state.tsx +++ b/x-pack/plugins/infra/public/containers/metrics_explorer/with_metrics_explorer_options_url_state.tsx @@ -5,13 +5,13 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; -import React, { useContext, useMemo } from 'react'; +import { set } from '@kbn/safer-lodash-set'; +import React, { useMemo } from 'react'; import { ThrowReporter } from 'io-ts/lib/ThrowReporter'; import { UrlStateContainer } from '../../utils/url_state'; import { MetricsExplorerOptions, - MetricsExplorerOptionsContainer, + useMetricsExplorerOptionsContainerContext, MetricsExplorerTimeOptions, MetricsExplorerChartOptions, metricExplorerOptionsRT, @@ -33,7 +33,7 @@ export const WithMetricsExplorerOptionsUrlState = () => { currentTimerange, setOptions: setRawOptions, setTimeRange, - } = useContext(MetricsExplorerOptionsContainer.Context); + } = useMetricsExplorerOptionsContainerContext(); const setOptions = (value: MetricsExplorerOptions) => { setRawOptions(value); diff --git a/x-pack/plugins/infra/public/containers/metrics_source/source.tsx b/x-pack/plugins/infra/public/containers/metrics_source/source.tsx index 393cad266a123..6a7c7aedccc62 100644 --- a/x-pack/plugins/infra/public/containers/metrics_source/source.tsx +++ b/x-pack/plugins/infra/public/containers/metrics_source/source.tsx @@ -157,5 +157,4 @@ export const useSource = ({ sourceId }: { sourceId: string }) => { }; }; -export const Source = createContainer(useSource); -export const [SourceProvider, useSourceContext] = Source; +export const [SourceProvider, useSourceContext] = createContainer(useSource); diff --git a/x-pack/plugins/infra/public/containers/saved_view/saved_view.tsx b/x-pack/plugins/infra/public/containers/saved_view/saved_view.tsx index e2bb50e0dc2da..8eb3d4c50de1a 100644 --- a/x-pack/plugins/infra/public/containers/saved_view/saved_view.tsx +++ b/x-pack/plugins/infra/public/containers/saved_view/saved_view.tsx @@ -10,14 +10,14 @@ import * as rt from 'io-ts'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { constant, identity } from 'fp-ts/lib/function'; -import { useCallback, useMemo, useState, useEffect, useContext } from 'react'; +import { useCallback, useMemo, useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; import { SimpleSavedObject, SavedObjectAttributes } from '@kbn/core/public'; import { useUrlState } from '../../utils/use_url_state'; import { useFindSavedObject } from '../../hooks/use_find_saved_object'; import { useCreateSavedObject } from '../../hooks/use_create_saved_object'; import { useDeleteSavedObject } from '../../hooks/use_delete_saved_object'; -import { Source } from '../metrics_source'; +import { useSourceContext } from '../metrics_source'; import { metricsExplorerViewSavedObjectName } from '../../../common/saved_objects/metrics_explorer_view'; import { inventoryViewSavedObjectName } from '../../../common/saved_objects/inventory_view'; import { useSourceConfigurationFormState } from '../../pages/metrics/settings/source_configuration_form_state'; @@ -59,7 +59,7 @@ export const useSavedView = (props: Props) => { sourceExists, createSourceConfiguration, updateSourceConfiguration, - } = useContext(Source.Context); + } = useSourceContext(); const { viewType, defaultViewState } = props; type ViewState = typeof defaultViewState; const { diff --git a/x-pack/plugins/infra/public/containers/with_source/with_source.tsx b/x-pack/plugins/infra/public/containers/with_source/with_source.tsx index 148b679018c7d..b2730cbf2e880 100644 --- a/x-pack/plugins/infra/public/containers/with_source/with_source.tsx +++ b/x-pack/plugins/infra/public/containers/with_source/with_source.tsx @@ -5,14 +5,14 @@ * 2.0. */ -import React, { useContext } from 'react'; +import React from 'react'; import { MetricsSourceConfigurationProperties, PartialMetricsSourceConfigurationProperties, } from '../../../common/metrics_sources'; import { RendererFunction } from '../../utils/typed_react'; -import { Source } from '../metrics_source'; +import { useSourceContext } from '../metrics_source'; import { CreateDerivedIndexPattern } from '../metrics_source'; interface WithSourceProps { @@ -52,7 +52,7 @@ export const WithSource: React.FunctionComponent = ({ children loadSourceFailureMessage, updateSourceConfiguration, version, - } = useContext(Source.Context); + } = useSourceContext(); return children({ create: createSourceConfiguration, diff --git a/x-pack/plugins/infra/public/pages/link_to/link_to_logs.test.tsx b/x-pack/plugins/infra/public/pages/link_to/link_to_logs.test.tsx index 6f4b0e73f0c33..5ed7ab99b4a3e 100644 --- a/x-pack/plugins/infra/public/pages/link_to/link_to_logs.test.tsx +++ b/x-pack/plugins/infra/public/pages/link_to/link_to_logs.test.tsx @@ -11,7 +11,7 @@ import React from 'react'; import { Route, Router, Switch } from 'react-router-dom'; import { httpServiceMock } from '@kbn/core/public/mocks'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { useLogView } from '../../hooks/use_log_view'; import { createLoadedUseLogViewMock, diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx index 13dd004a1a5ce..6dff4b41ecf53 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx @@ -22,7 +22,7 @@ import { DatasetsSelector } from '../../../components/logging/log_analysis_resul import { RecreateJobButton } from '../../../components/logging/log_analysis_setup/create_job_button'; import { useLogAnalysisCapabilitiesContext } from '../../../containers/logs/log_analysis/log_analysis_capabilities'; import { useLogEntryCategoriesModuleContext } from '../../../containers/logs/log_analysis/modules/log_entry_categories'; -import { ViewLogInContext } from '../../../containers/logs/view_log_in_context'; +import { ViewLogInContextProvider } from '../../../containers/logs/view_log_in_context'; import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; import { useLogViewContext } from '../../../hooks/use_log_view'; import { LogsPageTemplate } from '../page_template'; @@ -205,7 +205,7 @@ export const LogEntryCategoriesResultsContent: React.FunctionComponent< }); return ( - - + ); }; diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx index be5806d2b3064..091cbb1ba07b7 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useState, useCallback, useContext } from 'react'; +import React, { useState, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import { encode } from 'rison-node'; import moment from 'moment'; @@ -17,7 +17,7 @@ import { getFriendlyNameForPartitionId, partitionField, } from '../../../../../../common/log_analysis'; -import { ViewLogInContext } from '../../../../../containers/logs/view_log_in_context'; +import { useViewLogInProviderContext } from '../../../../../containers/logs/view_log_in_context'; import { LogEntryColumn, LogEntryFieldColumn, @@ -41,7 +41,7 @@ export const CategoryExampleMessage: React.FunctionComponent<{ context: LogEntryContext; }> = ({ id, dataset, message, timestamp, timeRange, tiebreaker, context }) => { const trackMetric = useUiTracker({ app: 'infra_logs' }); - const [, { setContextEntry }] = useContext(ViewLogInContext.Context); + const [, { setContextEntry }] = useViewLogInProviderContext(); // handle special cases for the dataset value const humanFriendlyDataset = getFriendlyNameForPartitionId(dataset); diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_providers.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_providers.tsx index 53e74ecf54320..f944b089d5d7d 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_providers.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_providers.tsx @@ -11,7 +11,7 @@ import { LogSourceErrorPage } from '../../../components/logging/log_source_error import { SourceLoadingPage } from '../../../components/source_loading_page'; import { LogEntryCategoriesModuleProvider } from '../../../containers/logs/log_analysis/modules/log_entry_categories'; import { LogEntryRateModuleProvider } from '../../../containers/logs/log_analysis/modules/log_entry_rate'; -import { LogFlyout } from '../../../containers/logs/log_flyout'; +import { LogEntryFlyoutProvider } from '../../../containers/logs/log_flyout'; import { useActiveKibanaSpace } from '../../../hooks/use_kibana_space'; import { useLogViewContext } from '../../../hooks/use_log_view'; @@ -38,7 +38,7 @@ export const LogEntryRatePageProviders: React.FunctionComponent = ({ children }) return ; } else if (resolvedLogView != null) { return ( - + {children} - + ); } else { return null; diff --git a/x-pack/plugins/infra/public/pages/logs/page_template.tsx b/x-pack/plugins/infra/public/pages/logs/page_template.tsx index 32a5be3e071c7..3fb8884f963c4 100644 --- a/x-pack/plugins/infra/public/pages/logs/page_template.tsx +++ b/x-pack/plugins/infra/public/pages/logs/page_template.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import { NoDataConfig } from '@kbn/shared-ux-page-kibana-template'; import { useKibanaContextForPlugin } from '../../hooks/use_kibana'; interface LogsPageTemplateProps extends LazyObservabilityPageTemplateProps { @@ -35,7 +35,7 @@ export const LogsPageTemplate: React.FC = ({ const { http } = useKibana().services; const basePath = http!.basePath.get(); - const noDataConfig: KibanaPageTemplateProps['noDataConfig'] = hasData + const noDataConfig: NoDataConfig | undefined = hasData ? undefined : { solution: i18n.translate('xpack.infra.logs.noDataConfig.solutionName', { diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx index 2cb7b2c6f5a7b..18ac30bb35e14 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx @@ -7,7 +7,7 @@ import { EuiSpacer } from '@elastic/eui'; import type { Query } from '@kbn/es-query'; -import React, { useCallback, useContext, useEffect, useMemo } from 'react'; +import React, { useCallback, useEffect, useMemo } from 'react'; import usePrevious from 'react-use/lib/usePrevious'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { LogEntry } from '../../../../common/log_entry'; @@ -18,17 +18,17 @@ import { LogMinimap } from '../../../components/logging/log_minimap'; import { ScrollableLogTextStreamView } from '../../../components/logging/log_text_stream'; import { LogEntryStreamItem } from '../../../components/logging/log_text_stream/item'; import { PageContent } from '../../../components/page'; -import { LogFilterState } from '../../../containers/logs/log_filter'; +import { useLogFilterStateContext } from '../../../containers/logs/log_filter'; import { useLogEntryFlyoutContext, WithFlyoutOptionsUrlState, } from '../../../containers/logs/log_flyout'; -import { LogHighlightsState } from '../../../containers/logs/log_highlights'; -import { LogPositionState } from '../../../containers/logs/log_position'; +import { useLogHighlightsStateContext } from '../../../containers/logs/log_highlights'; +import { useLogPositionStateContext } from '../../../containers/logs/log_position'; import { useLogStreamContext } from '../../../containers/logs/log_stream'; import { WithSummary } from '../../../containers/logs/log_summary'; -import { LogViewConfiguration } from '../../../containers/logs/log_view_configuration'; -import { ViewLogInContext } from '../../../containers/logs/view_log_in_context'; +import { useLogViewConfigurationContext } from '../../../containers/logs/log_view_configuration'; +import { useViewLogInProviderContext } from '../../../containers/logs/view_log_in_context'; import { WithLogTextviewUrlState } from '../../../containers/logs/with_log_textview'; import { useLogViewContext } from '../../../hooks/use_log_view'; import { datemathToEpochMillis, isValidDatemath } from '../../../utils/datemath'; @@ -39,7 +39,7 @@ const PAGE_THRESHOLD = 2; export const LogsPageLogsContent: React.FunctionComponent = () => { const { resolvedLogView, logView, logViewId } = useLogViewContext(); - const { textScale, textWrap } = useContext(LogViewConfiguration.Context); + const { textScale, textWrap } = useLogViewConfigurationContext(); const { surroundingLogsId, setSurroundingLogsId, @@ -64,8 +64,8 @@ export const LogsPageLogsContent: React.FunctionComponent = () => { endDateExpression, updateDateRange, lastCompleteDateRangeExpressionUpdate, - } = useContext(LogPositionState.Context); - const { filterQuery, applyLogFilterQuery } = useContext(LogFilterState.Context); + } = useLogPositionStateContext(); + const { filterQuery, applyLogFilterQuery } = useLogFilterStateContext(); const { isReloading, @@ -132,9 +132,8 @@ export const LogsPageLogsContent: React.FunctionComponent = () => { prevLastCompleteDateRangeExpressionUpdate, ]); - const { logSummaryHighlights, currentHighlightKey, logEntryHighlightsById } = useContext( - LogHighlightsState.Context - ); + const { logSummaryHighlights, currentHighlightKey, logEntryHighlightsById } = + useLogHighlightsStateContext(); const items = useMemo( () => @@ -147,7 +146,7 @@ export const LogsPageLogsContent: React.FunctionComponent = () => { [entries, isReloading, logEntryHighlightsById] ); - const [, { setContextEntry }] = useContext(ViewLogInContext.Context); + const [, { setContextEntry }] = useViewLogInProviderContext(); const handleDateRangeExtension = useCallback( (newDateRange) => { diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx index 11aa74ca862ad..ea2af542586a2 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx @@ -5,29 +5,37 @@ * 2.0. */ -import React, { useContext } from 'react'; -import { LogFilterState, WithLogFilterUrlState } from '../../../containers/logs/log_filter'; -import { LogFlyout } from '../../../containers/logs/log_flyout'; -import { LogHighlightsState } from '../../../containers/logs/log_highlights/log_highlights'; -import { LogPositionState, WithLogPositionUrlState } from '../../../containers/logs/log_position'; +import React from 'react'; +import { + LogFilterStateProvider, + useLogFilterStateContext, + WithLogFilterUrlState, +} from '../../../containers/logs/log_filter'; +import { LogEntryFlyoutProvider } from '../../../containers/logs/log_flyout'; +import { LogHighlightsStateProvider } from '../../../containers/logs/log_highlights/log_highlights'; +import { + LogPositionStateProvider, + useLogPositionStateContext, + WithLogPositionUrlState, +} from '../../../containers/logs/log_position'; import { LogStreamProvider, useLogStreamContext } from '../../../containers/logs/log_stream'; -import { LogViewConfiguration } from '../../../containers/logs/log_view_configuration'; -import { ViewLogInContext } from '../../../containers/logs/view_log_in_context'; +import { LogViewConfigurationProvider } from '../../../containers/logs/log_view_configuration'; +import { ViewLogInContextProvider } from '../../../containers/logs/view_log_in_context'; import { useLogViewContext } from '../../../hooks/use_log_view'; -const LogFilterStateProvider: React.FC = ({ children }) => { +const LogFilterState: React.FC = ({ children }) => { const { derivedDataView } = useLogViewContext(); return ( - + {children} - + ); }; -const ViewLogInContextProvider: React.FC = ({ children }) => { - const { startTimestamp, endTimestamp } = useContext(LogPositionState.Context); +const ViewLogInContext: React.FC = ({ children }) => { + const { startTimestamp, endTimestamp } = useLogPositionStateContext(); const { logViewId } = useLogViewContext(); if (!startTimestamp || !endTimestamp) { @@ -35,22 +43,21 @@ const ViewLogInContextProvider: React.FC = ({ children }) => { } return ( - {children} - + ); }; const LogEntriesStateProvider: React.FC = ({ children }) => { const { logViewId } = useLogViewContext(); - const { startTimestamp, endTimestamp, targetPosition, isInitialized } = useContext( - LogPositionState.Context - ); - const { filterQuery } = useContext(LogFilterState.Context); + const { startTimestamp, endTimestamp, targetPosition, isInitialized } = + useLogPositionStateContext(); + const { filterQuery } = useLogFilterStateContext(); // Don't render anything if the date range is incorrect. if (!startTimestamp || !endTimestamp) { @@ -76,10 +83,10 @@ const LogEntriesStateProvider: React.FC = ({ children }) => { ); }; -const LogHighlightsStateProvider: React.FC = ({ children }) => { +const LogHighlightsState: React.FC = ({ children }) => { const { logViewId, logView } = useLogViewContext(); const { topCursor, bottomCursor, entries } = useLogStreamContext(); - const { filterQuery } = useContext(LogFilterState.Context); + const { filterQuery } = useLogFilterStateContext(); const highlightsProps = { sourceId: logViewId, @@ -90,7 +97,7 @@ const LogHighlightsStateProvider: React.FC = ({ children }) => { size: entries.length, filterQuery: filterQuery?.serializedQuery ?? null, }; - return {children}; + return {children}; }; export const LogsPageProviders: React.FunctionComponent = ({ children }) => { @@ -102,19 +109,19 @@ export const LogsPageProviders: React.FunctionComponent = ({ children }) => { } return ( - - - + + + - - + + - {children} + {children} - - - - - + + + + + ); }; diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx index e3b2f01b6712e..6076849b79f12 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { Query } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; -import React, { useContext } from 'react'; +import React from 'react'; import { QueryStringInput } from '@kbn/unified-search-plugin/public'; import { DataView } from '@kbn/data-views-plugin/public'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; @@ -17,21 +17,20 @@ import { LogDatepicker } from '../../../components/logging/log_datepicker'; import { LogHighlightsMenu } from '../../../components/logging/log_highlights_menu'; import { LogTextScaleControls } from '../../../components/logging/log_text_scale_controls'; import { LogTextWrapControls } from '../../../components/logging/log_text_wrap_controls'; -import { LogFilterState } from '../../../containers/logs/log_filter'; -import { LogFlyout } from '../../../containers/logs/log_flyout'; -import { LogHighlightsState } from '../../../containers/logs/log_highlights/log_highlights'; -import { LogPositionState } from '../../../containers/logs/log_position'; -import { LogViewConfiguration } from '../../../containers/logs/log_view_configuration'; +import { useLogFilterStateContext } from '../../../containers/logs/log_filter'; +import { useLogEntryFlyoutContext } from '../../../containers/logs/log_flyout'; +import { useLogHighlightsStateContext } from '../../../containers/logs/log_highlights/log_highlights'; +import { useLogPositionStateContext } from '../../../containers/logs/log_position'; +import { useLogViewConfigurationContext } from '../../../containers/logs/log_view_configuration'; import { useLogViewContext } from '../../../hooks/use_log_view'; export const LogsToolbar = () => { const { derivedDataView } = useLogViewContext(); - const { availableTextScales, setTextScale, setTextWrap, textScale, textWrap } = useContext( - LogViewConfiguration.Context - ); + const { availableTextScales, setTextScale, setTextWrap, textScale, textWrap } = + useLogViewConfigurationContext(); const { filterQueryDraft, isFilterQueryDraftValid, applyLogFilterQuery, setLogFilterQueryDraft } = - useContext(LogFilterState.Context); - const { setSurroundingLogsId } = useContext(LogFlyout.Context); + useLogFilterStateContext(); + const { setSurroundingLogsId } = useLogEntryFlyoutContext(); const { setHighlightTerms, @@ -41,7 +40,7 @@ export const LogsToolbar = () => { hasNextHighlight, goToPreviousHighlight, goToNextHighlight, - } = useContext(LogHighlightsState.Context); + } = useLogHighlightsStateContext(); const { isStreaming, startLiveStreaming, @@ -49,7 +48,7 @@ export const LogsToolbar = () => { startDateExpression, endDateExpression, updateDateRange, - } = useContext(LogPositionState.Context); + } = useLogPositionStateContext(); return (
diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_view_log_in_context.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_view_log_in_context.tsx index 7afc8e19c43ee..9b4a2ffb4185b 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_view_log_in_context.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_view_log_in_context.tsx @@ -15,10 +15,10 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { isEmpty } from 'lodash'; -import React, { useCallback, useContext, useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { LogEntry } from '../../../../common/log_entry'; -import { ViewLogInContext } from '../../../containers/logs/view_log_in_context'; +import { useViewLogInProviderContext } from '../../../containers/logs/view_log_in_context'; import { useViewportDimensions } from '../../../utils/use_viewport_dimensions'; import { LogStream } from '../../../components/log_stream'; @@ -26,7 +26,7 @@ const MODAL_MARGIN = 25; export const PageViewLogInContext: React.FC = () => { const [{ contextEntry, startTimestamp, endTimestamp, sourceId }, { setContextEntry }] = - useContext(ViewLogInContext.Context); + useViewLogInProviderContext(); const closeModal = useCallback(() => setContextEntry(undefined), [setContextEntry]); const { width: vw, height: vh } = useViewportDimensions(); diff --git a/x-pack/plugins/infra/public/pages/metrics/index.tsx b/x-pack/plugins/infra/public/pages/metrics/index.tsx index f4d42b5994eb5..e2f4705f17b7d 100644 --- a/x-pack/plugins/infra/public/pages/metrics/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/index.tsx @@ -20,11 +20,12 @@ import { HelpCenterContent } from '../../components/help_center_content'; import { useReadOnlyBadge } from '../../hooks/use_readonly_badge'; import { MetricsExplorerOptionsContainer, + useMetricsExplorerOptionsContainerContext, DEFAULT_METRICS_EXPLORER_VIEW_STATE, } from './metrics_explorer/hooks/use_metrics_explorer_options'; import { WithMetricsExplorerOptionsUrlState } from '../../containers/metrics_explorer/with_metrics_explorer_options_url_state'; import { WithSource } from '../../containers/with_source'; -import { Source } from '../../containers/metrics_source'; +import { SourceProvider } from '../../containers/metrics_source'; import { MetricsExplorerPage } from './metrics_explorer'; import { SnapshotPage } from './inventory_view'; import { MetricDetail } from './metric_detail'; @@ -65,7 +66,7 @@ export const InfrastructurePage = ({ match }: RouteComponentProps) => { return ( - + @@ -109,7 +110,7 @@ export const InfrastructurePage = ({ match }: RouteComponentProps) => { render={(props) => ( {({ configuration, createDerivedIndexPattern }) => ( - + {configuration ? ( { ) : ( )} - + )} )} @@ -132,7 +133,7 @@ export const InfrastructurePage = ({ match }: RouteComponentProps) => { - + ); }; @@ -142,7 +143,7 @@ const PageContent = (props: { createDerivedIndexPattern: CreateDerivedIndexPattern; }) => { const { createDerivedIndexPattern, configuration } = props; - const { options } = useContext(MetricsExplorerOptionsContainer.Context); + const { options } = useMetricsExplorerOptionsContainerContext(); return ( { const nodeId = props.node.id; const nodeType = props.nodeType as InventoryItemType; const inventoryModel = findInventoryModel(nodeType); - const { sourceId } = useContext(Source.Context); + const { sourceId } = useSourceContext(); const { currentTimeRange } = useWaffleTimeContext(); const { loading, metadata } = useMetadata( nodeId, diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/index.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/index.tsx index 22c2af5496a60..65fa3bcfd0164 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/index.tsx @@ -5,12 +5,12 @@ * 2.0. */ -import React, { useCallback, useContext, useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiLoadingChart } from '@elastic/eui'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { TabContent, TabProps } from '../shared'; -import { Source } from '../../../../../../../containers/metrics_source'; +import { useSourceContext } from '../../../../../../../containers/metrics_source'; import { findInventoryModel } from '../../../../../../../../common/inventory_models'; import { InventoryItemType } from '../../../../../../../../common/inventory_models/types'; import { useMetadata } from '../../../../../metric_detail/hooks/use_metadata'; @@ -23,7 +23,7 @@ const TabComponent = (props: TabProps) => { const nodeId = props.node.id; const nodeType = props.nodeType as InventoryItemType; const inventoryModel = findInventoryModel(nodeType); - const { sourceId } = useContext(Source.Context); + const { sourceId } = useSourceContext(); const { currentTimeRange } = useWaffleTimeContext(); const { applyFilterQuery } = useWaffleFiltersContext(); const { loading: metadataLoading, metadata } = useMetadata( diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/search_bar.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/search_bar.tsx index 1b9e33a0c4dfb..7386322774442 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/search_bar.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/search_bar.tsx @@ -5,15 +5,15 @@ * 2.0. */ -import React, { useContext } from 'react'; +import React from 'react'; import { i18n } from '@kbn/i18n'; -import { Source } from '../../../../containers/metrics_source'; +import { useSourceContext } from '../../../../containers/metrics_source'; import { AutocompleteField } from '../../../../components/autocomplete_field'; import { WithKueryAutocompletion } from '../../../../containers/with_kuery_autocompletion'; import { useWaffleFiltersContext } from '../hooks/use_waffle_filters'; export const SearchBar = () => { - const { createDerivedIndexPattern } = useContext(Source.Context); + const { createDerivedIndexPattern } = useSourceContext(); const { applyFilterQueryFromKueryExpression, filterQueryDraft, diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx index 47e8d739d73e8..0c00b87722c8c 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx @@ -7,7 +7,7 @@ import { EuiErrorBoundary } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import React, { useContext } from 'react'; +import React from 'react'; import { useTrackPageview } from '@kbn/observability-plugin/public'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { APP_WRAPPER_CLASS } from '@kbn/core/public'; @@ -17,7 +17,7 @@ import { DocumentTitle } from '../../../components/document_title'; import { SourceErrorPage } from '../../../components/source_error_page'; import { SourceLoadingPage } from '../../../components/source_loading_page'; -import { Source } from '../../../containers/metrics_source'; +import { useSourceContext } from '../../../containers/metrics_source'; import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs'; import { LayoutView } from './components/layout_view'; import { SavedViewProvider } from '../../../containers/saved_view/saved_view'; @@ -36,7 +36,7 @@ export const SnapshotPage = () => { loadSource, source, metricIndicesExist, - } = useContext(Source.Context); + } = useSourceContext(); useTrackPageview({ app: 'infra_metrics', path: 'inventory' }); useTrackPageview({ app: 'infra_metrics', path: 'inventory', delay: 15000 }); const { source: optionsSource } = useWaffleOptionsContext(); diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx index cf766bdb104e5..339374678ab7f 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx @@ -5,11 +5,11 @@ * 2.0. */ -import React, { useCallback, useEffect, useState, useContext } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; import dateMath from '@kbn/datemath'; import moment from 'moment'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { Source } from '../../../../containers/metrics_source'; +import { useSourceContext } from '../../../../containers/metrics_source'; import { InventoryMetric, InventoryItemType } from '../../../../../common/inventory_models/types'; import { useNodeDetails } from '../hooks/use_node_details'; import { MetricsSideNav } from './side_nav'; @@ -53,7 +53,7 @@ const parseRange = (range: MetricsTimeInput) => { }; export const NodeDetailsPage = (props: Props) => { - const { metricIndicesExist } = useContext(Source.Context); + const { metricIndicesExist } = useSourceContext(); const [parsedTimeRange, setParsedTimeRange] = useState(parseRange(props.timeRange)); const { metrics, loading, makeRequest, error } = useNodeDetails( props.requiredMetrics, diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/index.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/index.tsx index e6843b98cf701..823b9d703f502 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/index.tsx @@ -6,14 +6,14 @@ */ import { i18n } from '@kbn/i18n'; -import React, { useContext, useState } from 'react'; +import React, { useState } from 'react'; import { EuiTheme, withTheme } from '@kbn/kibana-react-plugin/common'; import { useLinkProps } from '@kbn/observability-plugin/public'; import { DocumentTitle } from '../../../components/document_title'; import { withMetricPageProviders } from './page_providers'; import { useMetadata } from './hooks/use_metadata'; import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs'; -import { Source } from '../../../containers/metrics_source'; +import { useSourceContext } from '../../../containers/metrics_source'; import { InfraLoadingPanel } from '../../../components/loading'; import { findInventoryModel } from '../../../../common/inventory_models'; import { NavItem } from './lib/side_nav_context'; @@ -38,7 +38,7 @@ export const MetricDetail = withMetricPageProviders( const nodeId = match.params.node; const nodeType = match.params.type as InventoryItemType; const inventoryModel = findInventoryModel(nodeType); - const { sourceId, metricIndicesExist } = useContext(Source.Context); + const { sourceId, metricIndicesExist } = useSourceContext(); const { timeRange, diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/page_providers.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/page_providers.tsx index 6f44d49ddce90..eec4c7db0977b 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/page_providers.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/page_providers.tsx @@ -7,7 +7,7 @@ import { EuiErrorBoundary } from '@elastic/eui'; import React from 'react'; -import { Source } from '../../../containers/metrics_source'; +import { SourceProvider } from '../../../containers/metrics_source'; import { MetricsTimeProvider } from './hooks/use_metrics_time'; export const withMetricPageProviders = @@ -15,10 +15,10 @@ export const withMetricPageProviders = (props: T) => ( - + - + ); diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts index 7db25ae6898f1..a4e5cc4b92791 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts @@ -7,7 +7,7 @@ import { encode } from 'rison-node'; import uuid from 'uuid'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { LinkDescriptor } from '@kbn/observability-plugin/public'; import { TIMESTAMP_FIELD } from '../../../../../../common/constants'; import { MetricsSourceConfigurationProperties } from '../../../../../../common/metrics_sources'; diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.test.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.test.tsx index 67d3a71b6c1d4..3cd74c3560aa2 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.test.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.test.tsx @@ -25,9 +25,7 @@ const renderUseMetricsExplorerStateHook = () => renderHook((props) => useMetricsExplorerState(props.source, props.derivedIndexPattern), { initialProps: { source, derivedIndexPattern }, wrapper: ({ children }) => ( - - {children} - + {children} ), }); diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts index 39eb7c928997b..4842125a6ff0c 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useState, useCallback, useContext } from 'react'; +import { useState, useCallback } from 'react'; import { DataViewBase } from '@kbn/es-query'; import { MetricsSourceConfigurationProperties } from '../../../../../common/metrics_sources'; import { @@ -14,7 +14,7 @@ import { } from '../../../../../common/http_api/metrics_explorer'; import { useMetricsExplorerData } from './use_metrics_explorer_data'; import { - MetricsExplorerOptionsContainer, + useMetricsExplorerOptionsContainerContext, MetricsExplorerChartOptions, MetricsExplorerTimeOptions, MetricsExplorerOptions, @@ -42,7 +42,7 @@ export const useMetricsExplorerState = ( setChartOptions, setTimeRange, setOptions, - } = useContext(MetricsExplorerOptionsContainer.Context); + } = useMetricsExplorerOptionsContainerContext(); const { loading, error, data, loadData } = useMetricsExplorerData( options, diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options.ts b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options.ts index 8bf64edcf8970..02cab766c57e9 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options.ts +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options.ts @@ -208,4 +208,5 @@ export const useMetricsExplorerOptions = () => { }; }; -export const MetricsExplorerOptionsContainer = createContainer(useMetricsExplorerOptions); +export const [MetricsExplorerOptionsContainer, useMetricsExplorerOptionsContainerContext] = + createContainer(useMetricsExplorerOptions); diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx index a475ae1c88c9a..f5269b99fd5c9 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx @@ -7,7 +7,7 @@ import { EuiErrorBoundary } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import React, { useEffect, useContext } from 'react'; +import React, { useEffect } from 'react'; import { useTrackPageview } from '@kbn/observability-plugin/public'; import { MetricsSourceConfigurationProperties } from '../../../../common/metrics_sources'; import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs'; @@ -16,7 +16,7 @@ import { NoData } from '../../../components/empty_states'; import { MetricsExplorerCharts } from './components/charts'; import { MetricsExplorerToolbar } from './components/toolbar'; import { useMetricsExplorerState } from './hooks/use_metric_explorer_state'; -import { Source } from '../../../containers/metrics_source'; +import { useSourceContext } from '../../../containers/metrics_source'; import { useSavedViewContext } from '../../../containers/saved_view/saved_view'; import { MetricsPageTemplate } from '../page_template'; import { metricsExplorerTitle } from '../../../translations'; @@ -51,7 +51,7 @@ export const MetricsExplorerPage = ({ source, derivedIndexPattern }: MetricsExpl useTrackPageview({ app: 'infra_metrics', path: 'metrics_explorer' }); useTrackPageview({ app: 'infra_metrics', path: 'metrics_explorer', delay: 15000 }); - const { metricIndicesExist } = useContext(Source.Context); + const { metricIndicesExist } = useSourceContext(); useEffect(() => { if (currentView) { onViewStateChange(currentView); diff --git a/x-pack/plugins/infra/public/pages/metrics/page_template.tsx b/x-pack/plugins/infra/public/pages/metrics/page_template.tsx index 53a0cc21dd7ce..4d4dec50dd74c 100644 --- a/x-pack/plugins/infra/public/pages/metrics/page_template.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/page_template.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { NoDataConfig } from '@kbn/shared-ux-page-kibana-template'; import React from 'react'; import { noMetricIndicesPromptDescription, @@ -33,7 +33,7 @@ export const MetricsPageTemplate: React.FC = ({ }, } = useKibanaContextForPlugin(); - const noDataConfig: KibanaPageTemplateProps['noDataConfig'] = hasData + const noDataConfig: NoDataConfig | undefined = hasData ? undefined : { solution: i18n.translate('xpack.infra.metrics.noDataConfig.solutionName', { diff --git a/x-pack/plugins/infra/public/pages/metrics/settings/source_configuration_settings.tsx b/x-pack/plugins/infra/public/pages/metrics/settings/source_configuration_settings.tsx index eab8a82bc2d1e..1b21dfbc800f3 100644 --- a/x-pack/plugins/infra/public/pages/metrics/settings/source_configuration_settings.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/settings/source_configuration_settings.tsx @@ -15,10 +15,10 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import React, { useCallback, useContext, useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; import { Prompt } from '@kbn/observability-plugin/public'; import { SourceLoadingPage } from '../../../components/source_loading_page'; -import { Source } from '../../../containers/metrics_source'; +import { useSourceContext } from '../../../containers/metrics_source'; import { useInfraMLCapabilitiesContext } from '../../../containers/ml/infra_ml_capabilities'; import { IndicesConfigurationPanel } from './indices_configuration_panel'; import { MLConfigurationPanel } from './ml_configuration_panel'; @@ -48,7 +48,7 @@ export const SourceConfigurationSettings = ({ isLoading, isUninitialized, updateSourceConfiguration, - } = useContext(Source.Context); + } = useSourceContext(); const { indicesConfigurationProps, diff --git a/x-pack/plugins/infra/server/lib/metrics/index.ts b/x-pack/plugins/infra/server/lib/metrics/index.ts index c4641e265ea55..54dd69adb3ff4 100644 --- a/x-pack/plugins/infra/server/lib/metrics/index.ts +++ b/x-pack/plugins/infra/server/lib/metrics/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { ThrowReporter } from 'io-ts/lib/ThrowReporter'; import { TIMESTAMP_FIELD } from '../../../common/constants'; import { MetricsAPIRequest, MetricsAPIResponse, afterKeyObjectRT } from '../../../common/http_api'; diff --git a/x-pack/plugins/infra/server/routes/metadata/lib/get_node_info.ts b/x-pack/plugins/infra/server/routes/metadata/lib/get_node_info.ts index 97a0707a4c215..bc93d1f539e2a 100644 --- a/x-pack/plugins/infra/server/routes/metadata/lib/get_node_info.ts +++ b/x-pack/plugins/infra/server/routes/metadata/lib/get_node_info.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { first, startsWith } from 'lodash'; import type { InfraPluginRequestHandlerContext } from '../../../types'; import { KibanaFramework } from '../../../lib/adapters/framework/kibana_framework_adapter'; diff --git a/x-pack/plugins/infra/server/utils/create_afterkey_handler.ts b/x-pack/plugins/infra/server/utils/create_afterkey_handler.ts index 6d41f17a6bb5e..de797385c7171 100644 --- a/x-pack/plugins/infra/server/utils/create_afterkey_handler.ts +++ b/x-pack/plugins/infra/server/utils/create_afterkey_handler.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { InfraDatabaseSearchResponse } from '../lib/adapters/framework'; export const createAfterKeyHandler = diff --git a/x-pack/plugins/kubernetes_security/public/components/container_name_widget/hooks.ts b/x-pack/plugins/kubernetes_security/public/components/container_name_widget/hooks.ts index 66dcbc5b50265..c1b7c091b17a4 100644 --- a/x-pack/plugins/kubernetes_security/public/components/container_name_widget/hooks.ts +++ b/x-pack/plugins/kubernetes_security/public/components/container_name_widget/hooks.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useInfiniteQuery } from 'react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { QUERY_KEY_CONTAINER_NAME_WIDGET, AGGREGATE_ROUTE } from '../../../common/constants'; diff --git a/x-pack/plugins/kubernetes_security/public/components/count_widget/hooks.ts b/x-pack/plugins/kubernetes_security/public/components/count_widget/hooks.ts index d194e74ae8c62..936419d06c703 100644 --- a/x-pack/plugins/kubernetes_security/public/components/count_widget/hooks.ts +++ b/x-pack/plugins/kubernetes_security/public/components/count_widget/hooks.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useInfiniteQuery } from 'react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { QUERY_KEY_COUNT_WIDGET, COUNT_ROUTE } from '../../../common/constants'; diff --git a/x-pack/plugins/kubernetes_security/public/components/percent_widget/hooks.ts b/x-pack/plugins/kubernetes_security/public/components/percent_widget/hooks.ts index f13cdfa0ac7a4..5f5bf99ffd26f 100644 --- a/x-pack/plugins/kubernetes_security/public/components/percent_widget/hooks.ts +++ b/x-pack/plugins/kubernetes_security/public/components/percent_widget/hooks.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { QUERY_KEY_PERCENT_WIDGET, AGGREGATE_ROUTE } from '../../../common/constants'; diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/hooks.ts b/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/hooks.ts index ef6c849ee9242..0b8411e710728 100644 --- a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/hooks.ts +++ b/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/hooks.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useInfiniteQuery } from 'react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { QueryDslQueryContainerBool } from '../../../types'; diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.test.tsx b/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.test.tsx index 6a4595ddfb9a3..1763a881c2ba9 100644 --- a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.test.tsx +++ b/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.test.tsx @@ -18,8 +18,6 @@ describe('DynamicTreeView component', () => { let mockedContext: AppContextTestRender; let mockedApi: AppContextTestRender['coreStart']['http']['get']; - const waitForApiCall = () => waitFor(() => expect(mockedApi).toHaveBeenCalled()); - const defaultProps = { globalFilter: { startDate: Date.now().toString(), @@ -69,8 +67,9 @@ describe('DynamicTreeView component', () => { it('should show loading state while retrieving empty data and hide it when settled', async () => { render(); expect(renderResult.queryByText(/loading/i)).toBeInTheDocument(); - await waitForApiCall(); - expect(renderResult.queryByText(/loading/i)).not.toBeInTheDocument(); + await waitFor(() => { + expect(renderResult.queryByText(/loading/i)).not.toBeInTheDocument(); + }); }); }); @@ -92,39 +91,42 @@ describe('DynamicTreeView component', () => { render({ tree, }); - await waitForApiCall(); - expect(mockedApi).toHaveBeenCalledWith( - '/internal/kubernetes_security/multi_terms_aggregate', - { - query: { - groupBys: `[{"field":"${key}"},{"field":"orchestrator.cluster.name","missing":""}]`, - index: '*-logs', - page: 0, - perPage: 50, - query: '{"bool":{"filter":[],"must":[],"must_not":[],"should":[]}}', - }, - } - ); + await waitFor(() => { + expect(mockedApi).toHaveBeenCalledWith( + '/internal/kubernetes_security/multi_terms_aggregate', + { + query: { + groupBys: `[{"field":"${key}"},{"field":"orchestrator.cluster.name","missing":""}]`, + index: '*-logs', + page: 0, + perPage: 50, + query: '{"bool":{"filter":[],"must":[],"must_not":[],"should":[]}}', + }, + } + ); + }); }); it('should render the parent level based on api response', async () => { render({ tree, }); - await waitForApiCall(); - ['awp-demo-gke-main', 'awp-demo-gke-test'].forEach((cluster) => { - expect(renderResult.queryByText(cluster)).toBeInTheDocument(); + await waitFor(() => { + ['awp-demo-gke-main', 'awp-demo-gke-test'].forEach((cluster) => { + expect(renderResult.queryByText(cluster)).toBeInTheDocument(); + }); }); }); it('should trigger a callback when tree node is clicked', async () => { const callback = jest.fn(); render({ tree, onSelect: callback }); - await waitForApiCall(); - renderResult.getByRole('button', { name: 'awp-demo-gke-main' }).click(); + await waitFor(() => { + renderResult.getByRole('button', { name: 'awp-demo-gke-main' }).click(); + }); expect(callback).toHaveBeenCalled(); }); @@ -156,37 +158,43 @@ describe('DynamicTreeView component', () => { it('should make a children api call with filter when parent is expanded', async () => { render({ tree }); - await waitForApiCall(); - renderResult.getByRole('button', { name: parent }).click(); + await waitFor(() => { + renderResult.getByRole('button', { name: parent }).click(); + }); mockedApi.mockResolvedValueOnce(nodeResponseMock); - await waitForApiCall(); - expect(mockedApi).toHaveBeenCalledWith('/internal/kubernetes_security/aggregate', { - query: { - groupBy: 'node', - index: '*-logs', - page: 0, - perPage: 50, - query: `{"bool":{"filter":[{"term":{"orchestrator.cluster.id":"${parent}"}}],"must":[],"must_not":[],"should":[]}}`, - }, + await waitFor(() => { + expect(mockedApi).toHaveBeenCalledWith('/internal/kubernetes_security/aggregate', { + query: { + groupBy: 'node', + index: '*-logs', + page: 0, + perPage: 50, + query: `{"bool":{"filter":[{"term":{"orchestrator.cluster.id":"${parent}"}}],"must":[],"must_not":[],"should":[]}}`, + }, + }); }); }); it('should render children when parent is expanded based on api request', async () => { render({ tree }); - await waitForApiCall(); - renderResult.getByRole('button', { name: parent }).click(); - - mockedApi.mockResolvedValueOnce(nodeResponseMock); + await waitFor(() => { + expect(renderResult.getByRole('button', { name: parent })).toBeTruthy(); + mockedApi.mockResolvedValueOnce(nodeResponseMock); + renderResult.getByRole('button', { name: parent }).click(); + }); // check if children has loading state - expect(renderResult.queryByText(/loading/i)).toBeInTheDocument(); - await waitForApiCall(); + await waitFor(() => { + expect(renderResult.queryByText(/loading/i)).toBeInTheDocument(); + }); - ['default', 'kube-system', 'production', 'qa', 'staging'].forEach((node) => { - expect(renderResult.queryByText(node)).toBeInTheDocument(); + await waitFor(() => { + ['default', 'kube-system', 'production', 'qa', 'staging'].forEach((node) => { + expect(renderResult.queryByText(node)).toBeInTheDocument(); + }); }); }); }); diff --git a/x-pack/plugins/kubernetes_security/public/methods/index.tsx b/x-pack/plugins/kubernetes_security/public/methods/index.tsx index f0a140a612705..362560c3b1ddf 100644 --- a/x-pack/plugins/kubernetes_security/public/methods/index.tsx +++ b/x-pack/plugins/kubernetes_security/public/methods/index.tsx @@ -7,7 +7,7 @@ import React, { lazy, Suspense } from 'react'; import { EuiLoadingSpinner } from '@elastic/eui'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { KubernetesSecurityDeps } from '../types'; // Initializing react-query diff --git a/x-pack/plugins/kubernetes_security/public/test/index.tsx b/x-pack/plugins/kubernetes_security/public/test/index.tsx index 6174925b6003c..244560d366ac4 100644 --- a/x-pack/plugins/kubernetes_security/public/test/index.tsx +++ b/x-pack/plugins/kubernetes_security/public/test/index.tsx @@ -8,7 +8,7 @@ import React, { memo, ReactNode, useMemo } from 'react'; import { createMemoryHistory, MemoryHistory } from 'history'; import { render as reactRender, RenderOptions, RenderResult } from '@testing-library/react'; -import { QueryClient, QueryClientProvider, setLogger } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Router } from 'react-router-dom'; import { History } from 'history'; import useObservable from 'react-use/lib/useObservable'; @@ -20,15 +20,6 @@ import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; type UiRender = (ui: React.ReactElement, options?: RenderOptions) => RenderResult; -// hide react-query output in console -setLogger({ - error: () => {}, - // eslint-disable-next-line no-console - log: console.log, - // eslint-disable-next-line no-console - warn: console.warn, -}); - /** * Mocked app root context renderer */ @@ -113,6 +104,14 @@ export const createAppRootMockRenderer = (): AppContextTestRender => { cacheTime: Infinity, }, }, + // hide react-query output in console + logger: { + error: () => {}, + // eslint-disable-next-line no-console + log: console.log, + // eslint-disable-next-line no-console + warn: console.warn, + }, }); const AppWrapper: React.FC<{ children: React.ReactElement }> = ({ children }) => ( diff --git a/x-pack/plugins/lens/public/app_plugin/app.scss b/x-pack/plugins/lens/public/app_plugin/app.scss index 58ecce5592937..3aa98ca1640b9 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.scss +++ b/x-pack/plugins/lens/public/app_plugin/app.scss @@ -19,25 +19,6 @@ flex-grow: 1; } -.lensChartIcon__subdued { - fill: $euiTextSubduedColor; - - .lnsLayerChartSwitch__item-isSelected & { - fill: currentColor; - } -} - -.lensChartIcon__accent { - fill: $euiColorVis0; - - .lnsLayerChartSwitch__item-isSelected & { - fill: makeGraphicContrastColor($euiColorVis0, $euiColorDarkShade); - } -} -.lensAnnotationIconNoFill { - fill: none; -} - .lensAnnotationIconFill { fill: $euiColorEmptyShade; } 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 a2e247cc427c8..03cf38f141f0d 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.test.tsx +++ b/x-pack/plugins/lens/public/app_plugin/app.test.tsx @@ -882,8 +882,7 @@ describe('Lens App', () => { }); }); expect(checkForDuplicateTitle).toHaveBeenCalledWith( - expect.objectContaining({ id: '123' }), - false, + expect.objectContaining({ id: '123', isTitleDuplicateConfirmed: false }), onTitleDuplicate, expect.anything() ); diff --git a/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx b/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx index 6769010d8f721..373d632b2d51e 100644 --- a/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx +++ b/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx @@ -251,15 +251,13 @@ export const runSaveLensVisualization = async ( { id: originalSavedObjectId, title: docToSave.title, - copyOnSave: saveProps.newCopyOnSave, + displayName: i18n.translate('xpack.lens.app.saveModalType', { + defaultMessage: 'Lens visualization', + }), lastSavedTitle: lastKnownDoc.title, - getEsType: () => 'lens', - getDisplayName: () => - i18n.translate('xpack.lens.app.saveModalType', { - defaultMessage: 'Lens visualization', - }), + copyOnSave: saveProps.newCopyOnSave, + isTitleDuplicateConfirmed: saveProps.isTitleDuplicateConfirmed, }, - saveProps.isTitleDuplicateConfirmed, saveProps.onTitleDuplicate, { savedObjectsClient, diff --git a/x-pack/plugins/lens/public/assets/annotation_icons/circle.tsx b/x-pack/plugins/lens/public/assets/annotation_icons/circle.tsx deleted file mode 100644 index fe19dc7e4c8fc..0000000000000 --- a/x-pack/plugins/lens/public/assets/annotation_icons/circle.tsx +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import * as React from 'react'; -import { EuiIconProps } from '@elastic/eui'; -import classnames from 'classnames'; - -export const IconCircle = ({ title, titleId, ...props }: Omit) => ( - - {title ? {title} : null} - - -); diff --git a/x-pack/plugins/lens/public/assets/annotation_icons/triangle.tsx b/x-pack/plugins/lens/public/assets/annotation_icons/triangle.tsx deleted file mode 100644 index 9924c049004cf..0000000000000 --- a/x-pack/plugins/lens/public/assets/annotation_icons/triangle.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import * as React from 'react'; -import { EuiIconProps } from '@elastic/eui'; -import classnames from 'classnames'; - -export const IconTriangle = ({ title, titleId, ...props }: Omit) => ( - - {title ? {title} : null} - - -); diff --git a/x-pack/plugins/lens/public/assets/chart_area.tsx b/x-pack/plugins/lens/public/assets/chart_area.tsx deleted file mode 100644 index 664735205d97e..0000000000000 --- a/x-pack/plugins/lens/public/assets/chart_area.tsx +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const LensIconChartArea = ({ title, titleId, ...props }: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/x-pack/plugins/lens/public/assets/chart_bar.tsx b/x-pack/plugins/lens/public/assets/chart_bar.tsx deleted file mode 100644 index 991c9a6c74ced..0000000000000 --- a/x-pack/plugins/lens/public/assets/chart_bar.tsx +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const LensIconChartBar = ({ title, titleId, ...props }: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/x-pack/plugins/lens/public/assets/chart_bar_horizontal.tsx b/x-pack/plugins/lens/public/assets/chart_bar_horizontal.tsx deleted file mode 100644 index dfd25158cc295..0000000000000 --- a/x-pack/plugins/lens/public/assets/chart_bar_horizontal.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 React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const LensIconChartBarHorizontal = ({ - title, - titleId, - ...props -}: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/x-pack/plugins/lens/public/assets/chart_bar_horizontal_percentage.tsx b/x-pack/plugins/lens/public/assets/chart_bar_horizontal_percentage.tsx deleted file mode 100644 index a3c79991f2aff..0000000000000 --- a/x-pack/plugins/lens/public/assets/chart_bar_horizontal_percentage.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 React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const LensIconChartBarHorizontalPercentage = ({ - title, - titleId, - ...props -}: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/x-pack/plugins/lens/public/assets/chart_bar_horizontal_stacked.tsx b/x-pack/plugins/lens/public/assets/chart_bar_horizontal_stacked.tsx deleted file mode 100644 index d6abbaa37aaa0..0000000000000 --- a/x-pack/plugins/lens/public/assets/chart_bar_horizontal_stacked.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 React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const LensIconChartBarHorizontalStacked = ({ - title, - titleId, - ...props -}: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/x-pack/plugins/lens/public/assets/chart_bar_percentage.tsx b/x-pack/plugins/lens/public/assets/chart_bar_percentage.tsx deleted file mode 100644 index c297ee831f27c..0000000000000 --- a/x-pack/plugins/lens/public/assets/chart_bar_percentage.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 React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const LensIconChartBarPercentage = ({ - title, - titleId, - ...props -}: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/x-pack/plugins/lens/public/assets/chart_bar_stacked.tsx b/x-pack/plugins/lens/public/assets/chart_bar_stacked.tsx deleted file mode 100644 index c5775ce4bf859..0000000000000 --- a/x-pack/plugins/lens/public/assets/chart_bar_stacked.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 React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const LensIconChartBarStacked = ({ - title, - titleId, - ...props -}: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.tsx index e660df8ff7bb9..3ddf2a2cc4b75 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.tsx @@ -17,9 +17,6 @@ import { EuiFlexGroup, EuiFlexItem, EuiFocusTrap, - EuiOutsideClickDetector, - EuiWindowEvent, - keys, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -37,7 +34,10 @@ function fromExcludedClickTarget(event: Event) { node !== null; node = node!.parentElement ) { - if (node.classList!.contains(DONT_CLOSE_DIMENSION_CONTAINER_ON_CLICK_CLASS)) { + if ( + node.classList!.contains(DONT_CLOSE_DIMENSION_CONTAINER_ON_CLICK_CLASS) || + node.classList!.contains('euiBody-hasPortalContent') + ) { return true; } } @@ -69,18 +69,6 @@ export function DimensionContainer({ return canClose; }, [handleClose]); - const closeOnEscape = useCallback( - (event: KeyboardEvent) => { - if (event.key === keys.ESCAPE) { - const canClose = closeFlyout(); - if (canClose) { - event.preventDefault(); - } - } - }, - [closeFlyout] - ); - useEffect(() => { if (isOpen) { document.body.classList.add('lnsBody--overflowHidden'); @@ -94,81 +82,80 @@ export function DimensionContainer({ return isOpen ? (
- - - { - if (isFullscreen || fromExcludedClickTarget(event)) { - return; + { + if (isFullscreen || fromExcludedClickTarget(event)) { + return; + } + closeFlyout(); + }} + onEscapeKey={closeFlyout} + > +
{ + if (isOpen) { + // EuiFocusTrap interferes with animating elements with absolute position: + // running this onAnimationEnd, otherwise the flyout pushes content when animating + setFocusTrapIsEnabled(true); } - closeFlyout(); }} - isDisabled={!isOpen} > -
{ - if (isOpen) { - // EuiFocusTrap interferes with animating elements with absolute position: - // running this onAnimationEnd, otherwise the flyout pushes content when animating - setFocusTrapIsEnabled(true); - } - }} - > - - - - -

- - {i18n.translate('xpack.lens.configure.configurePanelTitle', { - defaultMessage: '{groupLabel}', - values: { - groupLabel, - }, - })} - -

-
-
+ + + + +

+ + {i18n.translate('xpack.lens.configure.configurePanelTitle', { + defaultMessage: '{groupLabel}', + values: { + groupLabel, + }, + })} + +

+
+
- - - -
-
+ + + +
+
-
{panel}
+
{panel}
- - - {i18n.translate('xpack.lens.dimensionContainer.close', { - defaultMessage: 'Close', - })} - - -
- + + + {i18n.translate('xpack.lens.dimensionContainer.close', { + defaultMessage: 'Close', + })} + + +
) : null; diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx index 86e896c29910c..544835d2e3c21 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx @@ -614,7 +614,8 @@ export function LayerPanel( setState: updateDataLayerState, supportStaticValue: Boolean(activeGroup.supportStaticValue), paramEditorCustomProps: activeGroup.paramEditorCustomProps, - supportFieldFormat: activeGroup.supportFieldFormat !== false, + enableFormatSelector: activeGroup.enableFormatSelector !== false, + formatSelectorOptions: activeGroup.formatSelectorOptions, layerType: activeVisualization.getLayerType(layerId, visualizationState), indexPatterns: dataViews.indexPatterns, existingFields: dataViews.existingFields, diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.test.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.test.tsx index 7eff9a5961e83..7f0034ad73366 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.test.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.test.tsx @@ -19,7 +19,7 @@ import { ReactExpressionRendererType } from '@kbn/expressions-plugin/public'; import { SuggestionPanel, SuggestionPanelProps, SuggestionPanelWrapper } from './suggestion_panel'; import { getSuggestions } from './suggestion_helpers'; import { EuiIcon, EuiPanel, EuiToolTip, EuiAccordion } from '@elastic/eui'; -import { LensIconChartDatatable } from '../../assets/chart_datatable'; +import { IconChartDatatable } from '@kbn/chart-icons'; import { mountWithProvider } from '../../mocks'; import { applyChanges, @@ -286,7 +286,7 @@ describe('suggestion_panel', () => { getSuggestionsMock.mockReturnValue([ { datasourceState: {}, - previewIcon: LensIconChartDatatable, + previewIcon: IconChartDatatable, score: 0.5, visualizationState: suggestion1State, visualizationId: 'testVis', @@ -317,7 +317,7 @@ describe('suggestion_panel', () => { expect(instance.find(SELECTORS.SUGGESTIONS_PANEL).find(EuiIcon)).toHaveLength(1); expect(instance.find(SELECTORS.SUGGESTIONS_PANEL).find(EuiIcon).prop('type')).toEqual( - LensIconChartDatatable + IconChartDatatable ); }); diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx index 8f32ff75c51f0..1d575d9809ad4 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx @@ -10,9 +10,9 @@ import { EuiPageContentBody, EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { UiActionsStart, VISUALIZE_GEO_FIELD_TRIGGER } from '@kbn/ui-actions-plugin/public'; +import { GlobeIllustration } from '@kbn/chart-icons'; import { getVisualizeGeoFieldMessage } from '../../../utils'; import { DragDrop } from '../../../drag_drop'; -import { GlobeIllustration } from '../../../assets/globe_illustration'; import { APP_ID } from '../../../../common/constants'; import './geo_field_workspace_panel.scss'; 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 9d23dd28b3707..07e5b0a3e8c1f 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 @@ -23,9 +23,9 @@ import { EuiSpacer, EuiTextColor, } from '@elastic/eui'; -import type { CoreStart, ApplicationStart } from '@kbn/core/public'; +import type { CoreStart } from '@kbn/core/public'; import type { DataPublicPluginStart, ExecutionContextSearch } from '@kbn/data-plugin/public'; -import { RedirectAppLinks } from '@kbn/kibana-react-plugin/public'; +import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; import type { ExpressionRendererEvent, ExpressionRenderError, @@ -35,6 +35,7 @@ import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import type { DefaultInspectorAdapters } from '@kbn/expressions-plugin/common'; import type { Datatable } from '@kbn/expressions-plugin/public'; +import { DropIllustration } from '@kbn/chart-icons'; import { trackUiCounterEvents } from '../../../lens_ui_telemetry'; import { FramePublicAPI, @@ -51,7 +52,6 @@ import { DragDrop, DragContext, DragDropIdentifier } from '../../../drag_drop'; import { switchToSuggestion } from '../suggestion_helpers'; import { buildExpression } from '../expression_helpers'; import { WorkspacePanelWrapper } from './workspace_panel_wrapper'; -import { DropIllustration } from '../../../assets/drop_illustration'; import applyChangesIllustrationDark from '../../../assets/render_dark@2x.png'; import applyChangesIllustrationLight from '../../../assets/render_light@2x.png'; import { @@ -547,7 +547,7 @@ export const InnerWorkspacePanel = React.memo(function InnerWorkspacePanel({ setLocalState={setLocalState} localState={{ ...localState, configurationValidationError, missingRefsErrors }} ExpressionRendererComponent={ExpressionRendererComponent} - application={core.application} + core={core} activeDatasourceId={activeDatasourceId} onRender$={onRender$} onData$={onData$} @@ -622,7 +622,7 @@ export const VisualizationWrapper = ({ setLocalState, localState, ExpressionRendererComponent, - application, + core, activeDatasourceId, onRender$, onData$, @@ -643,7 +643,7 @@ export const VisualizationWrapper = ({ unknownVisError?: Array<{ shortMessage: string; longMessage: React.ReactNode }>; }; ExpressionRendererComponent: ReactExpressionRendererType; - application: ApplicationStart; + core: CoreStart; activeDatasourceId: string | null; onRender$: () => void; onData$: (data: unknown, adapters?: Partial) => void; @@ -766,18 +766,18 @@ export const VisualizationWrapper = ({ if (localState.missingRefsErrors?.length) { // Check for access to both Management app && specific indexPattern section - const { management: isManagementEnabled } = application.capabilities.navLinks; + const { management: isManagementEnabled } = core.application.capabilities.navLinks; const isIndexPatternManagementEnabled = - application.capabilities.management.kibana.indexPatterns; + core.application.capabilities.management.kibana.indexPatterns; return ( + {!incompleteInfo && selectedColumn && temporaryState === 'none' && ( { @@ -1012,11 +1011,15 @@ export function DimensionEditor(props: DimensionEditorProps) { /> )} - {supportFieldFormat && + {enableFormatSelector && !isFullscreen && selectedColumn && (selectedColumn.dataType === 'number' || selectedColumn.operationType === 'range') ? ( - + ) : null}
diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx index 35bd94d448270..b64e12b7bf0a4 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx @@ -244,6 +244,8 @@ describe('IndexPatternDimensionEditorPanel', () => { isFullscreen: false, supportStaticValue: false, toggleFullscreen: jest.fn(), + enableFormatSelector: true, + formatSelectorOptions: undefined, }; jest.clearAllMocks(); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.test.tsx index 60fdb382322a6..d59cb4f136fda 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.test.tsx @@ -86,4 +86,18 @@ describe('FormatSelector', () => { component.update(); expect(props.onChange).toBeCalledWith({ id: 'bytes', params: { suffix: 'GB' } }); }); + describe('options', () => { + it('can disable the extra options', () => { + const props = getDefaultProps(); + const component = mount( + + ); + expect(component.exists('[data-test-subj="indexPattern-dimension-formatDecimals"]')).toBe( + false + ); + expect(component.exists('[data-test-subj="indexPattern-dimension-formatSuffix"]')).toBe( + false + ); + }); + }); }); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.tsx index 49231e64d53be..5a6fc9aab91eb 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.tsx @@ -51,9 +51,14 @@ const suffixLabel = i18n.translate('xpack.lens.indexPattern.suffixLabel', { defaultMessage: 'Suffix', }); +export interface FormatSelectorOptions { + disableExtraOptions?: boolean; +} + interface FormatSelectorProps { selectedColumn: GenericIndexPatternColumn; onChange: (newFormat?: { id: string; params?: Record }) => void; + options?: FormatSelectorOptions; } const RANGE_MIN = 0; @@ -149,9 +154,9 @@ export function FormatSelector(props: FormatSelectorProps) { selectedOptions={currentOption} onChange={onChangeWrapped} /> - {currentFormat ? ( + {currentFormat && !props.options?.disableExtraOptions ? ( <> - + - + + { diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx index 02ca96e147605..1ec3c3b41ca40 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx @@ -452,7 +452,12 @@ function FieldItemPopoverContents(props: State & FieldItemProps) { let title = <>; if (props.isLoading) { - return ; + return ( + <> + {panelHeader} + + + ); } else if (field.type.includes('range')) { return ( <> diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx index 50eb6df5723f7..40b2f66b2b93d 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx @@ -457,7 +457,7 @@ export const dateHistogramOperation: OperationDefinition< ); }, helpComponentTitle: i18n.translate('xpack.lens.indexPattern.dateHistogram.titleHelp', { - defaultMessage: 'How auto date histogram works', + defaultMessage: 'How Date histogram works', }), helpComponent() { const infiniteBound = i18n.translate('xpack.lens.indexPattern.dateHistogram.moreThanYear', { @@ -471,14 +471,14 @@ export const dateHistogramOperation: OperationDefinition< <>

{i18n.translate('xpack.lens.indexPattern.dateHistogram.autoBasicExplanation', { - defaultMessage: 'The auto date histogram splits a data field into buckets by interval.', + defaultMessage: 'Date histogram splits data into time intervals.', })}

{UI_SETTINGS.HISTOGRAM_MAX_BARS}, targetBarSetting: {UI_SETTINGS.HISTOGRAM_BAR_TARGET}, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.tsx index c4ab33c36f1f1..95021dd22900f 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.tsx @@ -32,29 +32,6 @@ export const FilterPopover = ({ }) => { const inputRef = React.useRef(); - // The following code is to prevent an keypress - // from propagating. - // - // TODO - It looks like EUI should be handling this - // (see https://github.com/elastic/eui/commit/ad97583b0d644690379f72c7a20879cfadb16e7a) - const popoverRef = React.useRef(null); - let panelElement: HTMLDivElement; - const panelRefCallback = (element: HTMLDivElement) => { - const listener = (event: KeyboardEvent) => { - if (event.key === 'Escape') { - event.stopPropagation(); - panelElement.removeEventListener('keydown', listener); - popoverRef.current?.closePopover(); - } - }; - - if (element) { - panelElement = element; - panelElement.addEventListener('keydown', listener); - } - }; - // End handling code - const setFilterLabel = (label: string) => setFilter({ ...filter, label }); const setFilterQuery = (input: Query) => setFilter({ ...filter, input }); @@ -70,14 +47,12 @@ export const FilterPopover = ({ return ( triggerClose()} + closePopover={triggerClose} button={button} > triggerClose()} + onSubmit={triggerClose} dataTestSubj="indexPattern-filters-label" /> diff --git a/x-pack/plugins/lens/public/lens_attribute_service.ts b/x-pack/plugins/lens/public/lens_attribute_service.ts index 6181fbf22ab26..7fe4065ede66d 100644 --- a/x-pack/plugins/lens/public/lens_attribute_service.ts +++ b/x-pack/plugins/lens/public/lens_attribute_service.ts @@ -80,12 +80,11 @@ export function getLensAttributeService( return checkForDuplicateTitle( { title: props.newTitle, - copyOnSave: false, + displayName: DOC_TYPE, + isTitleDuplicateConfirmed: props.isTitleDuplicateConfirmed, lastSavedTitle: '', - getEsType: () => DOC_TYPE, - getDisplayName: () => DOC_TYPE, + copyOnSave: false, }, - props.isTitleDuplicateConfirmed, props.onTitleDuplicate, { savedObjectsClient, diff --git a/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts b/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts index 8d6ca5c3b7640..c04db1f39ac61 100644 --- a/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts +++ b/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts @@ -6,26 +6,24 @@ */ import type { OverlayStart, SavedObjectsClientContract } from '@kbn/core/public'; -import type { SavedObject } from '@kbn/saved-objects-plugin/public'; +import { DOC_TYPE } from '../../../common'; import { SAVE_DUPLICATE_REJECTED } from './constants'; import { findObjectByTitle } from './find_object_by_title'; import { displayDuplicateTitleConfirmModal } from './display_duplicate_title_confirm_modal'; +import type { ConfirmModalSavedObjectMeta } from './types'; /** - * check for an existing SavedObject with the same title in ES + * check for an existing saved object with the same title in ES * returns Promise when it's no duplicate, or the modal displaying the warning * that's there's a duplicate is confirmed, else it returns a rejected Promise */ export async function checkForDuplicateTitle( - savedObject: Pick< - SavedObject, - 'id' | 'title' | 'getDisplayName' | 'lastSavedTitle' | 'copyOnSave' | 'getEsType' - >, - isTitleDuplicateConfirmed: boolean, + savedObjectMeta: ConfirmModalSavedObjectMeta, onTitleDuplicate: (() => void) | undefined, services: { savedObjectsClient: SavedObjectsClientContract; overlays: OverlayStart } -): Promise { +): Promise { const { savedObjectsClient, overlays } = services; + const { id, title, isTitleDuplicateConfirmed, lastSavedTitle, copyOnSave } = savedObjectMeta; // Don't check for duplicates if user has already confirmed save with duplicate title if (isTitleDuplicateConfirmed) { @@ -34,17 +32,13 @@ export async function checkForDuplicateTitle( // Don't check if the user isn't updating the title, otherwise that would become very annoying to have // to confirm the save every time, except when copyOnSave is true, then we do want to check. - if (savedObject.title === savedObject.lastSavedTitle && !savedObject.copyOnSave) { + if (title === lastSavedTitle && !copyOnSave) { return true; } - const duplicate = await findObjectByTitle( - savedObjectsClient, - savedObject.getEsType(), - savedObject.title - ); + const duplicate = await findObjectByTitle(savedObjectsClient, DOC_TYPE, title); - if (!duplicate || duplicate.id === savedObject.id) { + if (!duplicate || duplicate.id === id) { return true; } @@ -55,5 +49,5 @@ export async function checkForDuplicateTitle( // TODO: make onTitleDuplicate a required prop and remove UI components from this class // Need to leave here until all users pass onTitleDuplicate. - return displayDuplicateTitleConfirmModal(savedObject, overlays); + return displayDuplicateTitleConfirmModal(savedObjectMeta, overlays); } diff --git a/x-pack/plugins/lens/public/persistence/saved_objects_utils/confirm_modal_promise.tsx b/x-pack/plugins/lens/public/persistence/saved_objects_utils/confirm_modal_promise.tsx index c788660eea647..9b24a2be54ce2 100644 --- a/x-pack/plugins/lens/public/persistence/saved_objects_utils/confirm_modal_promise.tsx +++ b/x-pack/plugins/lens/public/persistence/saved_objects_utils/confirm_modal_promise.tsx @@ -16,7 +16,7 @@ export function confirmModalPromise( title = '', confirmBtnText = '', overlays: OverlayStart -): Promise { +): Promise { return new Promise((resolve, reject) => { const cancelButtonText = i18n.translate('xpack.lens.confirmModal.cancelButtonLabel', { defaultMessage: 'Cancel', diff --git a/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts b/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts index 6c5a94c8c3216..e0c61d202da72 100644 --- a/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts +++ b/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts @@ -7,25 +7,25 @@ import { i18n } from '@kbn/i18n'; import type { OverlayStart } from '@kbn/core/public'; -import type { SavedObject } from '@kbn/saved-objects-plugin/public'; +import type { ConfirmModalSavedObjectMeta } from './types'; import { SAVE_DUPLICATE_REJECTED } from './constants'; import { confirmModalPromise } from './confirm_modal_promise'; export function displayDuplicateTitleConfirmModal( - savedObject: Pick, + { title, displayName }: ConfirmModalSavedObjectMeta, overlays: OverlayStart -): Promise { +): Promise { const confirmMessage = i18n.translate( 'xpack.lens.confirmModal.saveDuplicateConfirmationMessage', { defaultMessage: `A {name} with the title '{title}' already exists. Would you like to save anyway?`, - values: { title: savedObject.title, name: savedObject.getDisplayName() }, + values: { title, name: displayName }, } ); const confirmButtonText = i18n.translate('xpack.lens.confirmModal.saveDuplicateButtonLabel', { defaultMessage: 'Save {name}', - values: { name: savedObject.getDisplayName() }, + values: { name: displayName }, }); try { return confirmModalPromise(confirmMessage, '', confirmButtonText, overlays); diff --git a/x-pack/plugins/lens/public/persistence/saved_objects_utils/find_object_by_title.test.ts b/x-pack/plugins/lens/public/persistence/saved_objects_utils/find_object_by_title.test.ts index 0d117220b895b..0e71b30b042e5 100644 --- a/x-pack/plugins/lens/public/persistence/saved_objects_utils/find_object_by_title.test.ts +++ b/x-pack/plugins/lens/public/persistence/saved_objects_utils/find_object_by_title.test.ts @@ -6,7 +6,7 @@ */ import { findObjectByTitle } from './find_object_by_title'; -import { SavedObjectsClientContract, SavedObject } from '@kbn/core/public'; +import { SavedObjectsClientContract, SimpleSavedObject } from '@kbn/core/public'; import { simpleSavedObjectMock } from '@kbn/core/public/mocks'; describe('findObjectByTitle', () => { @@ -24,7 +24,8 @@ describe('findObjectByTitle', () => { it('matches any case', async () => { const indexPattern = simpleSavedObjectMock.create(savedObjectsClient, { attributes: { title: 'foo' }, - } as SavedObject); + } as SimpleSavedObject); + savedObjectsClient.find = jest.fn().mockImplementation(() => Promise.resolve({ savedObjects: [indexPattern], diff --git a/x-pack/plugins/lens/public/persistence/saved_objects_utils/types.ts b/x-pack/plugins/lens/public/persistence/saved_objects_utils/types.ts new file mode 100644 index 0000000000000..49772c2db90a2 --- /dev/null +++ b/x-pack/plugins/lens/public/persistence/saved_objects_utils/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. + */ + +/** @internal */ +export interface ConfirmModalSavedObjectMeta { + id?: string; + title: string; + displayName: string; + lastSavedTitle: string; + copyOnSave: boolean; + isTitleDuplicateConfirmed: boolean; +} diff --git a/x-pack/plugins/lens/public/shared_components/debounced_input.test.tsx b/x-pack/plugins/lens/public/shared_components/debounced_input.test.tsx new file mode 100644 index 0000000000000..feab19d02c720 --- /dev/null +++ b/x-pack/plugins/lens/public/shared_components/debounced_input.test.tsx @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFieldText } from '@elastic/eui'; +import { mount } from 'enzyme'; +import { DebouncedInput } from './debounced_input'; +import { act } from 'react-dom/test-utils'; + +jest.mock('lodash', () => { + const original = jest.requireActual('lodash'); + + return { + ...original, + debounce: (fn: unknown) => fn, + }; +}); + +describe('DebouncedInput', () => { + it('should render', () => { + const mockOnChange = jest.fn(); + const wrapper = mount( + + ); + + const textProps = wrapper.find(EuiFieldText).props(); + expect(textProps.value).toBe('my value'); + expect(textProps.placeholder).toBe('default value'); + + act(() => { + textProps.onChange!({ + target: { value: 'new value' }, + } as unknown as React.ChangeEvent); + }); + expect(mockOnChange).toHaveBeenCalledWith('new value'); + }); + + it('should update placeholder when default value changes', () => { + const wrapper = mount( + {}} defaultValue={'old default'} /> + ); + + expect(wrapper.find(EuiFieldText).props().placeholder).toBe('old default'); + + act(() => { + wrapper.setProps({ defaultValue: 'new default' }); + }); + + expect(wrapper.find(EuiFieldText).props().placeholder).toBe('new default'); + }); + + it('should forward text field props', () => { + const wrapper = mount( + {}} + defaultValue={'old default'} + /> + ); + + expect(wrapper.find(EuiFieldText).props()).toEqual( + expect.objectContaining({ + compressed: true, + fullWidth: true, + readOnly: true, + }) + ); + }); +}); diff --git a/x-pack/plugins/lens/public/shared_components/debounced_input.tsx b/x-pack/plugins/lens/public/shared_components/debounced_input.tsx new file mode 100644 index 0000000000000..cd309a2bb0bfd --- /dev/null +++ b/x-pack/plugins/lens/public/shared_components/debounced_input.tsx @@ -0,0 +1,54 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFieldText, EuiFieldTextProps } from '@elastic/eui'; +import { useDebouncedValue } from './debounced_value'; + +type Props = { + value: string; + onChange: (value: string) => void; + defaultValue?: string; + allowFalsyValue?: boolean; +} & Omit; + +const DebouncedInputHelper = ({ + onChange, + value, + defaultValue, + allowFalsyValue, + ...rest +}: Props) => { + const { inputValue, handleInputChange, initialValue } = useDebouncedValue( + { + onChange, + value, + defaultValue, + }, + { allowFalsyValue } + ); + + return ( + { + handleInputChange(e.target.value); + }} + placeholder={initialValue} + /> + ); +}; + +/** + * When testing this component, mock the "debounce" function in lodash (see this module test for an example) + */ +export const DebouncedInput = (props: Props) => ( + // need this extra layer to force a rerender whenever the default value changes. + // this is because we need a new initialValue to be computed from the debounce hook. + +); diff --git a/x-pack/plugins/lens/public/shared_components/name_input.tsx b/x-pack/plugins/lens/public/shared_components/name_input.tsx index 9502c7df93d55..e455caa199dd0 100644 --- a/x-pack/plugins/lens/public/shared_components/name_input.tsx +++ b/x-pack/plugins/lens/public/shared_components/name_input.tsx @@ -7,8 +7,8 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiFormRow, EuiFieldText } from '@elastic/eui'; -import { useDebouncedValue } from '.'; +import { EuiFormRow } from '@elastic/eui'; +import { DebouncedInput } from './debounced_input'; export const NameInput = ({ value, @@ -19,12 +19,6 @@ export const NameInput = ({ onChange: (value: string) => void; defaultValue?: string; }) => { - const { inputValue, handleInputChange, initialValue } = useDebouncedValue({ - onChange, - value, - defaultValue, - }); - return ( - { - handleInputChange(e.target.value); - }} - placeholder={initialValue} + value={value} + onChange={onChange} + defaultValue={defaultValue} /> ); diff --git a/x-pack/plugins/lens/public/shared_components/toolbar_popover.tsx b/x-pack/plugins/lens/public/shared_components/toolbar_popover.tsx index 9d806b79f8311..dbb3d69588624 100644 --- a/x-pack/plugins/lens/public/shared_components/toolbar_popover.tsx +++ b/x-pack/plugins/lens/public/shared_components/toolbar_popover.tsx @@ -9,7 +9,7 @@ import './toolbar_popover.scss'; import React, { useState } from 'react'; import { EuiFlexItem, EuiPopover, EuiIcon, EuiPopoverTitle, IconType } from '@elastic/eui'; import { ToolbarButton, ToolbarButtonProps } from '@kbn/kibana-react-plugin/public'; -import { EuiIconLegend } from '../assets/legend'; +import { EuiIconLegend } from '@kbn/chart-icons'; const typeToIconMap: { [type: string]: string | IconType } = { legend: EuiIconLegend as IconType, diff --git a/x-pack/plugins/lens/public/types.ts b/x-pack/plugins/lens/public/types.ts index 0a76ceec5d315..d79a9b7579536 100644 --- a/x-pack/plugins/lens/public/types.ts +++ b/x-pack/plugins/lens/public/types.ts @@ -44,8 +44,9 @@ import { LENS_EDIT_PAGESIZE_ACTION, } from './visualizations/datatable/components/constants'; import type { LensInspector } from './lens_inspector_service'; -import { DataViewsState } from './state_management/types'; -import { IndexPatternServiceAPI } from './indexpattern_service/service'; +import type { FormatSelectorOptions } from './indexpattern_datasource/dimension_panel/format_selector'; +import type { DataViewsState } from './state_management/types'; +import type { IndexPatternServiceAPI } from './indexpattern_service/service'; export interface IndexPatternRef { id: string; @@ -538,7 +539,8 @@ export type DatasourceDimensionEditorProps = DatasourceDimensionPro layerType: LayerType | undefined; supportStaticValue: boolean; paramEditorCustomProps?: ParamEditorCustomProps; - supportFieldFormat?: boolean; + enableFormatSelector: boolean; + formatSelectorOptions: FormatSelectorOptions | undefined; }; export type DatasourceDimensionTriggerProps = DatasourceDimensionProps; @@ -698,7 +700,8 @@ export type VisualizationDimensionGroupConfig = SharedDimensionProps & { requiresPreviousColumnOnDuplicate?: boolean; supportStaticValue?: boolean; paramEditorCustomProps?: ParamEditorCustomProps; - supportFieldFormat?: boolean; + enableFormatSelector?: boolean; + formatSelectorOptions?: FormatSelectorOptions; // only relevant if supportFieldFormat is true labels?: { buttonAriaLabel: string; buttonLabel: string }; }; diff --git a/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.test.tsx b/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.test.tsx index e40b7b0c079ec..c1986b9ff7ef5 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.test.tsx @@ -14,7 +14,7 @@ import { IAggType } from '@kbn/data-plugin/public'; import { IFieldFormat, SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; import { VisualizationContainer } from '../../../visualization_container'; import { EmptyPlaceholder } from '@kbn/charts-plugin/public'; -import { LensIconChartDatatable } from '../../../assets/chart_datatable'; +import { IconChartDatatable } from '@kbn/chart-icons'; import { DataContext, DatatableComponent } from './table_basic'; import { DatatableProps } from '../../../../common/expressions'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; @@ -369,7 +369,7 @@ describe('DatatableComponent', () => { /> ); expect(component.find(VisualizationContainer)).toHaveLength(1); - expect(component.find(EmptyPlaceholder).prop('icon')).toEqual(LensIconChartDatatable); + expect(component.find(EmptyPlaceholder).prop('icon')).toEqual(IconChartDatatable); }); test('it renders the table with the given sorting', () => { diff --git a/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.tsx b/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.tsx index 0262d3d7cab40..fe0a7da701f2a 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.tsx @@ -29,12 +29,12 @@ import { } from '@elastic/eui'; import { EmptyPlaceholder } from '@kbn/charts-plugin/public'; import { ClickTriggerEvent } from '@kbn/charts-plugin/public'; +import { IconChartDatatable } from '@kbn/chart-icons'; import type { LensTableRowContextMenuEvent } from '../../../types'; import type { FormatFactory } from '../../../../common'; import type { LensGridDirection } from '../../../../common/expressions'; import { VisualizationContainer } from '../../../visualization_container'; import { findMinMaxByColumnId } from '../../../shared_components'; -import { LensIconChartDatatable } from '../../../assets/chart_datatable'; import type { DataContextType, DatatableRenderProps, @@ -413,7 +413,7 @@ export const DatatableComponent = (props: DatatableRenderProps) => { if (isEmpty) { return ( - + ); } diff --git a/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx b/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx index 36be3492680ea..8b9f2fe4bc4ed 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx @@ -14,13 +14,13 @@ import { PaletteRegistry, CUSTOM_PALETTE } from '@kbn/coloring'; import { ThemeServiceStart } from '@kbn/core/public'; import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; +import { IconChartDatatable } from '@kbn/chart-icons'; import type { SuggestionRequest, Visualization, VisualizationSuggestion, DatasourceLayers, } from '../../types'; -import { LensIconChartDatatable } from '../../assets/chart_datatable'; import { TableDimensionEditor } from './components/dimension_editor'; import { TableDimensionEditorAdditionalSection } from './components/dimension_editor_addtional_section'; import { LayerType, layerTypes } from '../../../common'; @@ -56,7 +56,7 @@ export const getDatatableVisualization = ({ visualizationTypes: [ { id: 'lnsDatatable', - icon: LensIconChartDatatable, + icon: IconChartDatatable, label: visualizationLabel, groupLabel: i18n.translate('xpack.lens.datatable.groupLabel', { defaultMessage: 'Tabular', @@ -82,7 +82,7 @@ export const getDatatableVisualization = ({ getDescription() { return { - icon: LensIconChartDatatable, + icon: IconChartDatatable, label: visualizationLabel, }; }, @@ -164,7 +164,7 @@ export const getDatatableVisualization = ({ columnId: col.columnId, })), }, - previewIcon: LensIconChartDatatable, + previewIcon: IconChartDatatable, // tables are hidden from suggestion bar, but used for drag & drop and chart switching hide: true, }, diff --git a/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts b/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts index 7282259108a92..94c9ce28987bf 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts @@ -108,7 +108,7 @@ describe('gauge', () => { required: true, dataTestSubj: 'lnsGauge_metricDimensionPanel', enableDimensionEditor: true, - supportFieldFormat: true, + enableFormatSelector: true, }, { layerId: 'first', @@ -124,7 +124,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_minDimensionPanel', prioritizedOperation: 'min', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, { @@ -141,7 +141,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_maxDimensionPanel', prioritizedOperation: 'max', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, { @@ -157,7 +157,7 @@ describe('gauge', () => { supportsMoreColumns: false, required: false, dataTestSubj: 'lnsGauge_goalDimensionPanel', - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, ], @@ -190,7 +190,7 @@ describe('gauge', () => { required: true, dataTestSubj: 'lnsGauge_metricDimensionPanel', enableDimensionEditor: true, - supportFieldFormat: true, + enableFormatSelector: true, }, { layerId: 'first', @@ -206,7 +206,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_minDimensionPanel', prioritizedOperation: 'min', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, { @@ -223,7 +223,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_maxDimensionPanel', prioritizedOperation: 'max', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, { @@ -239,7 +239,7 @@ describe('gauge', () => { supportsMoreColumns: true, required: false, dataTestSubj: 'lnsGauge_goalDimensionPanel', - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, ], @@ -278,7 +278,7 @@ describe('gauge', () => { required: true, dataTestSubj: 'lnsGauge_metricDimensionPanel', enableDimensionEditor: true, - supportFieldFormat: true, + enableFormatSelector: true, }, { layerId: 'first', @@ -294,7 +294,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_minDimensionPanel', prioritizedOperation: 'min', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, { @@ -311,7 +311,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_maxDimensionPanel', prioritizedOperation: 'max', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, { @@ -327,7 +327,7 @@ describe('gauge', () => { supportsMoreColumns: false, required: false, dataTestSubj: 'lnsGauge_goalDimensionPanel', - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, ], @@ -371,7 +371,7 @@ describe('gauge', () => { required: true, dataTestSubj: 'lnsGauge_metricDimensionPanel', enableDimensionEditor: true, - supportFieldFormat: true, + enableFormatSelector: true, }, { layerId: 'first', @@ -387,7 +387,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_minDimensionPanel', prioritizedOperation: 'min', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, invalid: true, invalidMessage: 'Minimum value may not be greater than maximum value', @@ -406,7 +406,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_maxDimensionPanel', prioritizedOperation: 'max', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, invalid: true, invalidMessage: 'Minimum value may not be greater than maximum value', @@ -424,7 +424,7 @@ describe('gauge', () => { supportsMoreColumns: false, required: false, dataTestSubj: 'lnsGauge_goalDimensionPanel', - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, ], diff --git a/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx b/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx index a531181a2cba5..37d10918d4129 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx @@ -21,9 +21,8 @@ import { getMaxValue, getMinValue, getValueFromAccessor, - VerticalBulletIcon, - HorizontalBulletIcon, } from '@kbn/expression-gauge-plugin/public'; +import { IconChartHorizontalBullet, IconChartVerticalBullet } from '@kbn/chart-icons'; import type { DatasourceLayers, OperationMetadata, Visualization } from '../../types'; import { getSuggestions } from './suggestions'; import { @@ -56,14 +55,14 @@ export const isNumericDynamicMetric = (op: OperationMetadata) => export const CHART_NAMES = { horizontalBullet: { - icon: HorizontalBulletIcon, + icon: IconChartHorizontalBullet, label: i18n.translate('xpack.lens.gaugeHorizontal.gaugeLabel', { defaultMessage: 'Gauge horizontal', }), groupLabel: groupLabelForGauge, }, verticalBullet: { - icon: VerticalBulletIcon, + icon: IconChartVerticalBullet, label: i18n.translate('xpack.lens.gaugeVertical.gaugeLabel', { defaultMessage: 'Gauge vertical', }), @@ -249,7 +248,7 @@ export const getGaugeVisualization = ({ return { groups: [ { - supportFieldFormat: true, + enableFormatSelector: true, layerId: state.layerId, groupId: GROUP_ID.METRIC, groupLabel: i18n.translate('xpack.lens.gauge.metricLabel', { @@ -282,7 +281,7 @@ export const getGaugeVisualization = ({ }, { supportStaticValue: true, - supportFieldFormat: false, + enableFormatSelector: false, layerId: state.layerId, groupId: GROUP_ID.MIN, groupLabel: i18n.translate('xpack.lens.gauge.minValueLabel', { @@ -308,7 +307,7 @@ export const getGaugeVisualization = ({ }, { supportStaticValue: true, - supportFieldFormat: false, + enableFormatSelector: false, layerId: state.layerId, groupId: GROUP_ID.MAX, groupLabel: i18n.translate('xpack.lens.gauge.maxValueLabel', { @@ -334,7 +333,7 @@ export const getGaugeVisualization = ({ }, { supportStaticValue: true, - supportFieldFormat: false, + enableFormatSelector: false, layerId: state.layerId, groupId: GROUP_ID.GOAL, groupLabel: i18n.translate('xpack.lens.gauge.goalValueLabel', { diff --git a/x-pack/plugins/lens/public/visualizations/heatmap/constants.ts b/x-pack/plugins/lens/public/visualizations/heatmap/constants.ts index 270d45ce3cec5..51e674048e873 100644 --- a/x-pack/plugins/lens/public/visualizations/heatmap/constants.ts +++ b/x-pack/plugins/lens/public/visualizations/heatmap/constants.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { HeatmapIcon } from '@kbn/expression-heatmap-plugin/public'; +import { IconChartHeatmap } from '@kbn/chart-icons'; export const LENS_HEATMAP_RENDERER = 'lens_heatmap_renderer'; @@ -24,7 +24,7 @@ export const CHART_SHAPES = { export const CHART_NAMES = { heatmap: { shapeType: CHART_SHAPES.HEATMAP, - icon: HeatmapIcon, + icon: IconChartHeatmap, label: i18n.translate('xpack.lens.heatmap.heatmapLabel', { defaultMessage: 'Heat map', }), diff --git a/x-pack/plugins/lens/public/visualizations/heatmap/toolbar_component.tsx b/x-pack/plugins/lens/public/visualizations/heatmap/toolbar_component.tsx index b0a80ca297a0a..d14bf621df08e 100644 --- a/x-pack/plugins/lens/public/visualizations/heatmap/toolbar_component.tsx +++ b/x-pack/plugins/lens/public/visualizations/heatmap/toolbar_component.tsx @@ -10,6 +10,7 @@ import { EuiFlexGroup, EuiFlexItem, IconType } from '@elastic/eui'; import { Position } from '@elastic/charts'; import { i18n } from '@kbn/i18n'; import { LegendSize } from '@kbn/visualizations-plugin/public'; +import { EuiIconAxisLeft, EuiIconAxisBottom } from '@kbn/chart-icons'; import type { VisualizationToolbarProps } from '../../types'; import { LegendSettingsPopover, @@ -18,8 +19,6 @@ import { AxisTitleSettings, TooltipWrapper, } from '../../shared_components'; -import { EuiIconAxisLeft } from '../../assets/axis_left'; -import { EuiIconAxisBottom } from '../../assets/axis_bottom'; import type { HeatmapVisualizationState } from './types'; import { getDefaultVisualValuesForLayer } from '../../shared_components/datasource_default_values'; import './toolbar_component.scss'; diff --git a/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx b/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx index 2f08a31151401..09548df0a67e4 100644 --- a/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx @@ -11,11 +11,11 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; import { Ast } from '@kbn/interpreter'; import { Position } from '@elastic/charts'; +import { IconChartHeatmap } from '@kbn/chart-icons'; import { CUSTOM_PALETTE, PaletteRegistry, CustomPaletteParams } from '@kbn/coloring'; import { ThemeServiceStart } from '@kbn/core/public'; import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; -import { HeatmapIcon } from '@kbn/expression-heatmap-plugin/public'; import type { OperationMetadata, Visualization } from '../../types'; import type { HeatmapVisualizationState } from './types'; import { getSuggestions } from './suggestions'; @@ -105,7 +105,7 @@ export const getHeatmapVisualization = ({ visualizationTypes: [ { id: 'heatmap', - icon: HeatmapIcon, + icon: IconChartHeatmap, label: i18n.translate('xpack.lens.heatmapVisualization.heatmapLabel', { defaultMessage: 'Heat map', }), diff --git a/x-pack/plugins/lens/public/visualizations/legacy_metric/metric_suggestions.ts b/x-pack/plugins/lens/public/visualizations/legacy_metric/metric_suggestions.ts index 32a5831618251..6fa35a8a17821 100644 --- a/x-pack/plugins/lens/public/visualizations/legacy_metric/metric_suggestions.ts +++ b/x-pack/plugins/lens/public/visualizations/legacy_metric/metric_suggestions.ts @@ -5,10 +5,10 @@ * 2.0. */ +import { IconChartMetric } from '@kbn/chart-icons'; import { SuggestionRequest, VisualizationSuggestion, TableSuggestion } from '../../types'; import type { MetricState } from '../../../common/types'; import { layerTypes } from '../../../common'; -import { LensIconChartMetric } from '../../assets/chart_metric'; import { legacyMetricSupportedTypes } from './visualization'; /** @@ -49,7 +49,7 @@ function getSuggestion(table: TableSuggestion): VisualizationSuggestion { const original = jest.requireActual('lodash'); @@ -64,39 +65,43 @@ describe('dimension editor', () => { palette, }; - const mockedFrame = createMockFramePublicAPI(); - - const props: VisualizationDimensionEditorProps & { + let props: VisualizationDimensionEditorProps & { paletteService: PaletteRegistry; - } = { - layerId: 'first', - groupId: 'some-group', - accessor: 'some-accessor', - state: fullState, - frame: mockedFrame, - setState: jest.fn(), - panelRef: {} as React.MutableRefObject, - paletteService: chartPluginMock.createPaletteRegistry(), }; + beforeEach(() => { + props = { + layerId: 'first', + groupId: 'some-group', + accessor: 'some-accessor', + state: fullState, + frame: createMockFramePublicAPI(), + setState: jest.fn(), + panelRef: {} as React.MutableRefObject, + paletteService: chartPluginMock.createPaletteRegistry(), + }; + }); + describe('primary metric dimension', () => { const accessor = 'primary-metric-col-id'; - props.frame.activeData = { - first: { - type: 'datatable', - columns: [ - { - id: accessor, - name: 'foo', - meta: { - type: 'number', + beforeEach(() => { + props.frame.activeData = { + first: { + type: 'datatable', + columns: [ + { + id: accessor, + name: 'foo', + meta: { + type: 'number', + }, }, - }, - ], - rows: [], - }, - }; + ], + rows: [], + }, + }; + }); class Harness { public _wrapper; @@ -200,6 +205,24 @@ describe('dimension editor', () => { describe('secondary metric dimension', () => { const accessor = 'secondary-metric-col-id'; + beforeEach(() => { + props.frame.activeData = { + first: { + type: 'datatable', + columns: [ + { + id: accessor, + name: 'foo', + meta: { + type: 'number', + }, + }, + ], + rows: [], + }, + }; + }); + it('renders when the accessor matches', () => { const component = shallow( { expect(component.exists(SELECTORS.PRIMARY_METRIC_EDITOR)).toBeFalsy(); }); - it('sets metric prefix', () => { - const setState = jest.fn(); - const localState = { ...fullState, secondaryMetricAccessor: accessor }; - const component = shallow( - - ); + describe('metric prefix', () => { + const NONE_PREFIX = ''; + const AUTO_PREFIX = undefined; + + it('activates the correct buttons', () => { + const setState = jest.fn(); + const localState = { + ...fullState, + secondaryPrefix: AUTO_PREFIX, + secondaryMetricAccessor: accessor, + }; + const component = mount( + + ); + + expect(component.find(EuiButtonGroup).props().idSelected).toContain('auto'); + + component.setProps({ + state: { + ...localState, + secondaryPrefix: NONE_PREFIX, + }, + }); - const newVal = 'Metric explanation'; - component.find(EuiFieldText).props().onChange!({ - target: { value: newVal }, - } as ChangeEvent); - expect(setState).toHaveBeenCalledWith({ ...localState, secondaryPrefix: newVal }); + expect(component.find(EuiButtonGroup).props().idSelected).toContain('none'); + + component.setProps({ + state: { + ...localState, + secondaryPrefix: 'some custom prefix', + }, + }); + + expect(component.find(EuiButtonGroup).props().idSelected).toContain('custom'); + }); + + it('clicking a button sets the prefix value', () => { + const setState = jest.fn(); + const localState = { + ...fullState, + secondaryPrefix: AUTO_PREFIX, + secondaryMetricAccessor: accessor, + }; + const component = mount( + + ); + + const newVal = 'Metric explanation'; + + component.find(EuiButtonGroup).props().onChange('some-id', newVal); + + expect(setState).toHaveBeenCalledWith({ ...localState, secondaryPrefix: newVal }); + }); + + it('sets a custom prefix value', () => { + const setState = jest.fn(); + const localState = { + ...fullState, + secondaryPrefix: 'foo', + secondaryMetricAccessor: accessor, + }; + const component = mount( + + ); + + const buttonGroup = component.find(EuiButtonGroup); + + // make sure that if the user was to select the "custom" option, they would get the default value + expect(buttonGroup.props().options[1].value).toBe('foo'); + + const newVal = 'bar'; + + component.find(DebouncedInput).props().onChange(newVal); + + expect(setState).toHaveBeenCalledWith({ ...localState, secondaryPrefix: newVal }); + }); }); }); diff --git a/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx index 198f3dd755ebc..4439b22cd705f 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx @@ -11,12 +11,12 @@ import { EuiColorPaletteDisplay, EuiFormRow, EuiFlexItem, - EuiFieldText, EuiButtonGroup, EuiFieldNumber, htmlIdGenerator, EuiColorPicker, euiPaletteColorBlind, + EuiSpacer, } from '@elastic/eui'; import { LayoutDirection } from '@elastic/charts'; import React, { useCallback, useState } from 'react'; @@ -30,6 +30,7 @@ import { } from '@kbn/coloring'; import { getDataBoundsForPalette } from '@kbn/expression-metric-vis-plugin/public'; import { css } from '@emotion/react'; +import { getColumnByAccessor } from '@kbn/visualizations-plugin/common/utils'; import { isNumericFieldForDatatable } from '../../../common/expressions'; import { applyPaletteParams, @@ -40,63 +41,42 @@ import type { VisualizationDimensionEditorProps } from '../../types'; import { defaultNumberPaletteParams, defaultPercentagePaletteParams } from './palette_config'; import { DEFAULT_MAX_COLUMNS, getDefaultColor, MetricVisualizationState } from './visualization'; import { CollapseSetting } from '../../shared_components/collapse_setting'; +import { DebouncedInput } from '../../shared_components/debounced_input'; type Props = VisualizationDimensionEditorProps & { paletteService: PaletteRegistry; }; -export function DimensionEditor(props: Props) { - const { state, setState, accessor } = props; +type SubProps = Props & { idPrefix: string }; - const setPrefix = useCallback( - (prefix: string) => setState({ ...state, secondaryPrefix: prefix }), - [setState, state] - ); +export function DimensionEditor(props: Props) { + const { state, accessor } = props; - const { inputValue: prefixInputVal, handleInputChange: handlePrefixChange } = - useDebouncedValue( - { - onChange: setPrefix, - value: state.secondaryPrefix || '', - }, - { allowFalsyValue: true } - ); + const idPrefix = htmlIdGenerator()(); switch (accessor) { case state?.metricAccessor: return (

- +
); case state.secondaryMetricAccessor: return (
- - handlePrefixChange(value)} - /> - +
); case state.maxAccessor: return ( -
- +
+
); case state.breakdownByAccessor: return (
- +
); default: @@ -104,7 +84,7 @@ export function DimensionEditor(props: Props) { } } -function BreakdownByEditor({ setState, state }: Props) { +function BreakdownByEditor({ setState, state }: SubProps) { const setMaxCols = useCallback( (columns: string) => { setState({ ...state, maxCols: parseInt(columns, 10) }); @@ -148,8 +128,7 @@ function BreakdownByEditor({ setState, state }: Props) { ); } -function MaximumEditor({ setState, state }: Props) { - const idPrefix = htmlIdGenerator()(); +function MaximumEditor({ setState, state, idPrefix }: SubProps) { return ( + + <> + { + setState({ + ...state, + secondaryPrefix, + }); + }} + /> + + {state.secondaryPrefix && ( + { + setState({ + ...state, + secondaryPrefix: newPrefix, + }); + }} + /> + )} + + +
+ ); +} + +function PrimaryMetricEditor(props: SubProps) { + const { state, setState, frame, accessor, idPrefix } = props; const [isPaletteOpen, setIsPaletteOpen] = useState(false); @@ -235,7 +294,6 @@ function PrimaryMetricEditor(props: Props) { const togglePalette = () => setIsPaletteOpen(!isPaletteOpen); - const idPrefix = htmlIdGenerator()(); return ( <> { }, title: 'Metric', hide: true, - previewIcon: LensIconChartMetric, + previewIcon: IconChartMetric, score: 0.51, }, ]); @@ -182,7 +182,7 @@ describe('metric suggestions', () => { }, title: 'Metric', hide: true, - previewIcon: LensIconChartMetric, + previewIcon: IconChartMetric, score: 0.51, }, ]); @@ -214,7 +214,7 @@ describe('metric suggestions', () => { }, title: 'Metric', hide: true, - previewIcon: LensIconChartMetric, + previewIcon: IconChartMetric, score: 0.51, }, ]); @@ -287,7 +287,7 @@ describe('metric suggestions', () => { }, title: 'Metric', hide: true, - previewIcon: LensIconChartMetric, + previewIcon: IconChartMetric, score: 0.52, }, ]); @@ -319,7 +319,7 @@ describe('metric suggestions', () => { }, title: 'Metric', hide: true, - previewIcon: LensIconChartMetric, + previewIcon: IconChartMetric, score: 0.52, }, ]); @@ -350,7 +350,7 @@ describe('metric suggestions', () => { }, title: 'Metric', hide: true, - previewIcon: LensIconChartMetric, + previewIcon: IconChartMetric, score: 0.52, }, ]); diff --git a/x-pack/plugins/lens/public/visualizations/metric/suggestions.ts b/x-pack/plugins/lens/public/visualizations/metric/suggestions.ts index cdb11812bc4b8..ae40bf83574f4 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/suggestions.ts +++ b/x-pack/plugins/lens/public/visualizations/metric/suggestions.ts @@ -5,8 +5,8 @@ * 2.0. */ +import { IconChartMetric } from '@kbn/chart-icons'; import type { TableSuggestion, Visualization } from '../../types'; -import { LensIconChartMetric } from '../../assets/chart_metric'; import { layerTypes } from '../../../common'; import { metricLabel, MetricVisualizationState, supportedDataTypes } from './visualization'; @@ -59,7 +59,7 @@ export const getSuggestions: Visualization['getSuggest layerType: layerTypes.DATA, }, title: metricLabel, - previewIcon: LensIconChartMetric, + previewIcon: IconChartMetric, score: 0.5, // don't show suggestions since we're in tech preview hide: true, diff --git a/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts b/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts index 91a7e0ffc2053..18e664ce4ea36 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts @@ -517,12 +517,8 @@ describe('metric visualization', () => { it('clears a layer', () => { expect(visualization.clearLayer(fullState, 'some-id')).toMatchInlineSnapshot(` Object { - "color": "static-color", "layerId": "first", "layerType": "data", - "maxCols": 5, - "progressDirection": "vertical", - "subtitle": "subtitle", } `); }); @@ -634,6 +630,7 @@ describe('metric visualization', () => { expect(removed).not.toHaveProperty('metricAccessor'); expect(removed).not.toHaveProperty('palette'); + expect(removed).not.toHaveProperty('color'); }); it('removes secondary metric dimension', () => { const removed = visualization.removeDimension({ @@ -651,6 +648,7 @@ describe('metric visualization', () => { }); expect(removed).not.toHaveProperty('maxAccessor'); + expect(removed).not.toHaveProperty('progressDirection'); }); it('removes breakdown-by dimension', () => { const removed = visualization.removeDimension({ @@ -660,6 +658,7 @@ describe('metric visualization', () => { expect(removed).not.toHaveProperty('breakdownByAccessor'); expect(removed).not.toHaveProperty('collapseFn'); + expect(removed).not.toHaveProperty('maxCols'); }); }); diff --git a/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx b/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx index 8651d4b76e95b..6d74b02bae120 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx @@ -16,15 +16,16 @@ import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import { LayoutDirection } from '@elastic/charts'; import { euiLightVars, euiThemeVars } from '@kbn/ui-theme'; import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; +import { IconChartMetric } from '@kbn/chart-icons'; import { LayerType } from '../../../common'; import { getSuggestions } from './suggestions'; -import { LensIconChartMetric } from '../../assets/chart_metric'; import { Visualization, OperationMetadata, DatasourceLayers, AccessorConfig } from '../../types'; import { layerTypes } from '../../../common'; import { GROUP_ID, LENS_METRIC_ID } from './constants'; import { DimensionEditor } from './dimension_editor'; import { Toolbar } from './toolbar'; import { generateId } from '../../id_generator'; +import { FormatSelectorOptions } from '../../indexpattern_datasource/dimension_panel/format_selector'; export const DEFAULT_MAX_COLUMNS = 3; @@ -125,7 +126,8 @@ const toExpression = ( arguments: { metric: state.metricAccessor ? [state.metricAccessor] : [], secondaryMetric: state.secondaryMetricAccessor ? [state.secondaryMetricAccessor] : [], - secondaryPrefix: state.secondaryPrefix ? [state.secondaryPrefix] : [], + secondaryPrefix: + typeof state.secondaryPrefix !== 'undefined' ? [state.secondaryPrefix] : [], max: state.maxAccessor ? [state.maxAccessor] : [], breakdownBy: state.breakdownByAccessor && !state.collapseFn ? [state.breakdownByAccessor] : [], @@ -154,6 +156,28 @@ const metricGroupLabel = i18n.translate('xpack.lens.metric.groupLabel', { defaultMessage: 'Goal and single value', }); +const removeMetricDimension = (state: MetricVisualizationState) => { + delete state.metricAccessor; + delete state.palette; + delete state.color; +}; + +const removeSecondaryMetricDimension = (state: MetricVisualizationState) => { + delete state.secondaryMetricAccessor; + delete state.secondaryPrefix; +}; + +const removeMaxDimension = (state: MetricVisualizationState) => { + delete state.maxAccessor; + delete state.progressDirection; +}; + +const removeBreakdownByDimension = (state: MetricVisualizationState) => { + delete state.breakdownByAccessor; + delete state.collapseFn; + delete state.maxCols; +}; + export const getMetricVisualization = ({ paletteService, theme, @@ -166,7 +190,7 @@ export const getMetricVisualization = ({ visualizationTypes: [ { id: LENS_METRIC_ID, - icon: LensIconChartMetric, + icon: IconChartMetric, label: metricLabel, groupLabel: metricGroupLabel, showExperimentalBadge: true, @@ -180,14 +204,13 @@ export const getMetricVisualization = ({ clearLayer(state) { const newState = { ...state }; - delete newState.metricAccessor; - delete newState.secondaryMetricAccessor; - delete newState.secondaryPrefix; - delete newState.breakdownByAccessor; - delete newState.collapseFn; - delete newState.maxAccessor; - delete newState.palette; - // TODO - clear more? + delete newState.subtitle; + + removeMetricDimension(newState); + removeSecondaryMetricDimension(newState); + removeMaxDimension(newState); + removeBreakdownByDimension(newState); + return newState; }, @@ -197,7 +220,7 @@ export const getMetricVisualization = ({ getDescription() { return { - icon: LensIconChartMetric, + icon: IconChartMetric, label: metricLabel, }; }, @@ -244,6 +267,10 @@ export const getMetricVisualization = ({ const isBucketed = (op: OperationMetadata) => op.isBucketed; + const formatterOptions: FormatSelectorOptions = { + disableExtraOptions: true, + }; + return { groups: [ { @@ -269,7 +296,8 @@ export const getMetricVisualization = ({ supportsMoreColumns: !props.state.metricAccessor, filterOperations: isSupportedDynamicMetric, enableDimensionEditor: true, - supportFieldFormat: false, + enableFormatSelector: true, + formatSelectorOptions: formatterOptions, required: true, }, { @@ -294,7 +322,8 @@ export const getMetricVisualization = ({ supportsMoreColumns: !props.state.secondaryMetricAccessor, filterOperations: isSupportedDynamicMetric, enableDimensionEditor: true, - supportFieldFormat: false, + enableFormatSelector: true, + formatSelectorOptions: formatterOptions, required: false, }, { @@ -317,7 +346,8 @@ export const getMetricVisualization = ({ supportsMoreColumns: !props.state.maxAccessor, filterOperations: isSupportedMetric, enableDimensionEditor: true, - supportFieldFormat: false, + enableFormatSelector: false, + formatSelectorOptions: formatterOptions, supportStaticValue: true, required: false, groupTooltip: i18n.translate('xpack.lens.metric.maxTooltip', { @@ -343,7 +373,8 @@ export const getMetricVisualization = ({ supportsMoreColumns: !props.state.breakdownByAccessor, filterOperations: isBucketed, enableDimensionEditor: true, - supportFieldFormat: false, + enableFormatSelector: true, + formatSelectorOptions: formatterOptions, required: false, }, ], @@ -404,20 +435,16 @@ export const getMetricVisualization = ({ const updated = { ...prevState }; if (prevState.metricAccessor === columnId) { - delete updated.metricAccessor; - delete updated.palette; - delete updated.color; + removeMetricDimension(updated); } if (prevState.secondaryMetricAccessor === columnId) { - delete updated.secondaryMetricAccessor; - delete updated.secondaryPrefix; + removeSecondaryMetricDimension(updated); } if (prevState.maxAccessor === columnId) { - delete updated.maxAccessor; + removeMaxDimension(updated); } if (prevState.breakdownByAccessor === columnId) { - delete updated.breakdownByAccessor; - delete updated.collapseFn; + removeBreakdownByDimension(updated); } return updated; diff --git a/x-pack/plugins/lens/public/visualizations/partition/partition_charts_meta.ts b/x-pack/plugins/lens/public/visualizations/partition/partition_charts_meta.ts index 6d948ce4332fc..888fe7853b27b 100644 --- a/x-pack/plugins/lens/public/visualizations/partition/partition_charts_meta.ts +++ b/x-pack/plugins/lens/public/visualizations/partition/partition_charts_meta.ts @@ -9,11 +9,13 @@ import { i18n } from '@kbn/i18n'; import type { EuiIconProps } from '@elastic/eui'; import type { DatatableColumn } from '@kbn/expressions-plugin/common'; -import { LensIconChartDonut } from '../../assets/chart_donut'; -import { LensIconChartPie } from '../../assets/chart_pie'; -import { LensIconChartTreemap } from '../../assets/chart_treemap'; -import { LensIconChartMosaic } from '../../assets/chart_mosaic'; -import { LensIconChartWaffle } from '../../assets/chart_waffle'; +import { + IconChartDonut, + IconChartPie, + IconChartTreemap, + IconChartMosaic, + IconChartWaffle, +} from '@kbn/chart-icons'; import { CategoryDisplay, NumberDisplay, @@ -140,7 +142,7 @@ const emptySizeRatioOptions: PartitionChartMeta['toolbarPopover']['emptySizeRati export const PartitionChartsMeta: Record = { donut: { - icon: LensIconChartDonut, + icon: IconChartDonut, label: i18n.translate('xpack.lens.pie.donutLabel', { defaultMessage: 'Donut', }), @@ -156,7 +158,7 @@ export const PartitionChartsMeta: Record = { }, }, pie: { - icon: LensIconChartPie, + icon: IconChartPie, label: i18n.translate('xpack.lens.pie.pielabel', { defaultMessage: 'Pie', }), @@ -171,7 +173,7 @@ export const PartitionChartsMeta: Record = { }, }, treemap: { - icon: LensIconChartTreemap, + icon: IconChartTreemap, label: i18n.translate('xpack.lens.pie.treemaplabel', { defaultMessage: 'Treemap', }), @@ -186,7 +188,7 @@ export const PartitionChartsMeta: Record = { }, }, mosaic: { - icon: LensIconChartMosaic, + icon: IconChartMosaic, label: i18n.translate('xpack.lens.pie.mosaiclabel', { defaultMessage: 'Mosaic', }), @@ -203,7 +205,7 @@ export const PartitionChartsMeta: Record = { requiredMinDimensionCount: 2, }, waffle: { - icon: LensIconChartWaffle, + icon: IconChartWaffle, label: i18n.translate('xpack.lens.pie.wafflelabel', { defaultMessage: 'Waffle', }), diff --git a/x-pack/plugins/lens/public/visualizations/xy/annotations/helpers.tsx b/x-pack/plugins/lens/public/visualizations/xy/annotations/helpers.tsx index 480417ab2cbad..4c60934ef9114 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/annotations/helpers.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/annotations/helpers.tsx @@ -13,6 +13,7 @@ import { isRangeAnnotation, } from '@kbn/event-annotation-plugin/public'; import { EventAnnotationConfig } from '@kbn/event-annotation-plugin/common'; +import { IconChartBarAnnotations } from '@kbn/chart-icons'; import { layerTypes } from '../../../../common'; import type { FramePublicAPI, Visualization } from '../../../types'; import { isHorizontalChart } from '../state_helpers'; @@ -24,7 +25,6 @@ import { getDataLayers, isAnnotationsLayer, } from '../visualization_helpers'; -import { LensIconChartBarAnnotations } from '../../../assets/chart_bar_annotations'; import { generateId } from '../../../id_generator'; const MAX_DATE = 8640000000000000; @@ -106,7 +106,7 @@ export const getAnnotationsSupportedLayer = ( label: i18n.translate('xpack.lens.xyChart.addAnnotationsLayerLabel', { defaultMessage: 'Annotations', }), - icon: LensIconChartBarAnnotations, + icon: IconChartBarAnnotations, disabled: !hasDateHistogram, toolTipContent: !hasDateHistogram ? i18n.translate('xpack.lens.xyChart.addAnnotationsLayerLabelDisabledHelp', { diff --git a/x-pack/plugins/lens/public/visualizations/xy/reference_line_helpers.tsx b/x-pack/plugins/lens/public/visualizations/xy/reference_line_helpers.tsx index 293dd8e67db8f..362b63c46eb2d 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/reference_line_helpers.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/reference_line_helpers.tsx @@ -8,6 +8,7 @@ import { groupBy, partition } from 'lodash'; import { i18n } from '@kbn/i18n'; import { Datatable } from '@kbn/expressions-plugin/public'; +import { IconChartBarReferenceLine } from '@kbn/chart-icons'; import { layerTypes } from '../../../common'; import type { DatasourceLayers, FramePublicAPI, Visualization } from '../../types'; import { groupAxesByType } from './axes_configuration'; @@ -28,7 +29,6 @@ import { isReferenceLayer, } from './visualization_helpers'; import { generateId } from '../../id_generator'; -import { LensIconChartBarReferenceLine } from '../../assets/chart_bar_reference_line'; import { defaultReferenceLineColor } from './color_assignment'; export interface ReferenceLineBase { @@ -318,7 +318,7 @@ export const getReferenceSupportedLayer = ( label: i18n.translate('xpack.lens.xyChart.addReferenceLineLayerLabel', { defaultMessage: 'Reference lines', }), - icon: LensIconChartBarReferenceLine, + icon: IconChartBarReferenceLine, disabled: !filledDataLayers.length || (!dataLayers.some(layerHasNumberHistogram) && diff --git a/x-pack/plugins/lens/public/visualizations/xy/types.ts b/x-pack/plugins/lens/public/visualizations/xy/types.ts index c2ca25c61c42e..8e140b83cb552 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/types.ts +++ b/x-pack/plugins/lens/public/visualizations/xy/types.ts @@ -22,16 +22,18 @@ import type { YAxisConfig, } from '@kbn/expression-xy-plugin/common'; import { EventAnnotationConfig } from '@kbn/event-annotation-plugin/common'; -import { LensIconChartArea } from '../../assets/chart_area'; -import { LensIconChartAreaStacked } from '../../assets/chart_area_stacked'; -import { LensIconChartAreaPercentage } from '../../assets/chart_area_percentage'; -import { LensIconChartBar } from '../../assets/chart_bar'; -import { LensIconChartBarStacked } from '../../assets/chart_bar_stacked'; -import { LensIconChartBarPercentage } from '../../assets/chart_bar_percentage'; -import { LensIconChartBarHorizontal } from '../../assets/chart_bar_horizontal'; -import { LensIconChartBarHorizontalStacked } from '../../assets/chart_bar_horizontal_stacked'; -import { LensIconChartBarHorizontalPercentage } from '../../assets/chart_bar_horizontal_percentage'; -import { LensIconChartLine } from '../../assets/chart_line'; +import { + IconChartArea, + IconChartLine, + IconChartAreaStacked, + IconChartBarHorizontalStacked, + IconChartBarHorizontalPercentage, + IconChartAreaPercentage, + IconChartBar, + IconChartBarStacked, + IconChartBarPercentage, + IconChartBarHorizontal, +} from '@kbn/chart-icons'; import type { VisualizationType, Suggestion } from '../../types'; import type { ValueLabelConfig } from '../../../common/types'; @@ -168,7 +170,7 @@ const groupLabelForLineAndArea = i18n.translate('xpack.lens.xyVisualization.line export const visualizationTypes: VisualizationType[] = [ { id: 'bar', - icon: LensIconChartBar, + icon: IconChartBar, label: i18n.translate('xpack.lens.xyVisualization.barLabel', { defaultMessage: 'Bar vertical', }), @@ -177,7 +179,7 @@ export const visualizationTypes: VisualizationType[] = [ }, { id: 'bar_horizontal', - icon: LensIconChartBarHorizontal, + icon: IconChartBarHorizontal, label: i18n.translate('xpack.lens.xyVisualization.barHorizontalLabel', { defaultMessage: 'H. Bar', }), @@ -188,7 +190,7 @@ export const visualizationTypes: VisualizationType[] = [ }, { id: 'bar_stacked', - icon: LensIconChartBarStacked, + icon: IconChartBarStacked, label: i18n.translate('xpack.lens.xyVisualization.stackedBarLabel', { defaultMessage: 'Bar vertical stacked', }), @@ -196,7 +198,7 @@ export const visualizationTypes: VisualizationType[] = [ }, { id: 'bar_percentage_stacked', - icon: LensIconChartBarPercentage, + icon: IconChartBarPercentage, label: i18n.translate('xpack.lens.xyVisualization.stackedPercentageBarLabel', { defaultMessage: 'Bar vertical percentage', }), @@ -204,7 +206,7 @@ export const visualizationTypes: VisualizationType[] = [ }, { id: 'bar_horizontal_stacked', - icon: LensIconChartBarHorizontalStacked, + icon: IconChartBarHorizontalStacked, label: i18n.translate('xpack.lens.xyVisualization.stackedBarHorizontalLabel', { defaultMessage: 'H. Stacked bar', }), @@ -215,7 +217,7 @@ export const visualizationTypes: VisualizationType[] = [ }, { id: 'bar_horizontal_percentage_stacked', - icon: LensIconChartBarHorizontalPercentage, + icon: IconChartBarHorizontalPercentage, label: i18n.translate('xpack.lens.xyVisualization.stackedPercentageBarHorizontalLabel', { defaultMessage: 'H. Percentage bar', }), @@ -229,7 +231,7 @@ export const visualizationTypes: VisualizationType[] = [ }, { id: 'area', - icon: LensIconChartArea, + icon: IconChartArea, label: i18n.translate('xpack.lens.xyVisualization.areaLabel', { defaultMessage: 'Area', }), @@ -237,7 +239,7 @@ export const visualizationTypes: VisualizationType[] = [ }, { id: 'area_stacked', - icon: LensIconChartAreaStacked, + icon: IconChartAreaStacked, label: i18n.translate('xpack.lens.xyVisualization.stackedAreaLabel', { defaultMessage: 'Area stacked', }), @@ -245,7 +247,7 @@ export const visualizationTypes: VisualizationType[] = [ }, { id: 'area_percentage_stacked', - icon: LensIconChartAreaPercentage, + icon: IconChartAreaPercentage, label: i18n.translate('xpack.lens.xyVisualization.stackedPercentageAreaLabel', { defaultMessage: 'Area percentage', }), @@ -253,7 +255,7 @@ export const visualizationTypes: VisualizationType[] = [ }, { id: 'line', - icon: LensIconChartLine, + icon: IconChartLine, label: i18n.translate('xpack.lens.xyVisualization.lineLabel', { defaultMessage: 'Line', }), diff --git a/x-pack/plugins/lens/public/visualizations/xy/visualization.test.ts b/x-pack/plugins/lens/public/visualizations/xy/visualization.test.ts index b1313d765ae92..6817046864783 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/xy/visualization.test.ts @@ -25,7 +25,7 @@ import type { } from './types'; import { layerTypes } from '../../../common'; import { createMockDatasource, createMockFramePublicAPI } from '../../mocks'; -import { LensIconChartBar } from '../../assets/chart_bar'; +import { IconChartBar } from '@kbn/chart-icons'; import type { VisualizeEditorLayersContext } from '@kbn/visualizations-plugin/public'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; import { fieldFormatsServiceMock } from '@kbn/field-formats-plugin/public/mocks'; @@ -109,7 +109,7 @@ describe('xy_visualization', () => { it('should show the preferredSeriesType if there are no layers', () => { const desc = xyVisualization.getDescription(mixedState()); - expect(desc.icon).toEqual(LensIconChartBar); + expect(desc.icon).toEqual(IconChartBar); expect(desc.label).toEqual('Bar vertical'); }); diff --git a/x-pack/plugins/lens/public/visualizations/xy/visualization_helpers.tsx b/x-pack/plugins/lens/public/visualizations/xy/visualization_helpers.tsx index c36916f7f0306..46bc1ba8dc551 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/visualization_helpers.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/visualization_helpers.tsx @@ -7,6 +7,7 @@ import { i18n } from '@kbn/i18n'; import { uniq } from 'lodash'; +import { IconChartBarHorizontal, IconChartBarStacked, IconChartMixedXy } from '@kbn/chart-icons'; import { DatasourceLayers, OperationMetadata, VisualizationType } from '../../types'; import { State, @@ -20,9 +21,6 @@ import { } from './types'; import { isHorizontalChart } from './state_helpers'; import { layerTypes } from '../..'; -import { LensIconChartBarHorizontal } from '../../assets/chart_bar_horizontal'; -import { LensIconChartMixedXy } from '../../assets/chart_mixed_xy'; -import { LensIconChartBarStacked } from '../../assets/chart_bar_stacked'; import { LayerType } from '../../../common'; export function getAxisName( @@ -192,7 +190,7 @@ export function getDescription(state?: State) { if (visualizationType === 'mixed' && isHorizontalChart(state.layers)) { return { - icon: LensIconChartBarHorizontal, + icon: IconChartBarHorizontal, label: i18n.translate('xpack.lens.xyVisualization.mixedBarHorizontalLabel', { defaultMessage: 'Mixed bar horizontal', }), @@ -201,7 +199,7 @@ export function getDescription(state?: State) { if (visualizationType === 'mixed') { return { - icon: LensIconChartMixedXy, + icon: IconChartMixedXy, label: i18n.translate('xpack.lens.xyVisualization.mixedLabel', { defaultMessage: 'Mixed XY', }), @@ -214,7 +212,7 @@ export function getDescription(state?: State) { }; } -export const defaultIcon = LensIconChartBarStacked; +export const defaultIcon = IconChartBarStacked; export const defaultSeriesType = 'bar_stacked'; export const supportedDataLayer = { @@ -222,7 +220,7 @@ export const supportedDataLayer = { label: i18n.translate('xpack.lens.xyChart.addDataLayerLabel', { defaultMessage: 'Visualization', }), - icon: LensIconChartMixedXy, + icon: IconChartMixedXy, }; // i18n ids cannot be dynamically generated, hence the function below diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/icon_set.ts b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/icon_set.ts index 80cf7eccc9622..23a4b6fb52610 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/icon_set.ts +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/icon_set.ts @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import { AvailableAnnotationIcon } from '@kbn/event-annotation-plugin/common'; -import { IconTriangle, IconCircle } from '../../../../assets/annotation_icons'; +import { IconTriangle, IconCircle } from '@kbn/chart-icons'; import { IconSet } from '../shared/icon_select'; export const annotationsIconSet: IconSet = [ diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/axis_settings_popover.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/axis_settings_popover.tsx index 65d7b94281486..cb02bb796a3aa 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/axis_settings_popover.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/axis_settings_popover.tsx @@ -18,7 +18,13 @@ import { i18n } from '@kbn/i18n'; import { isEqual } from 'lodash'; import { AxisExtentConfig, YScaleType } from '@kbn/expression-xy-plugin/common'; import { ToolbarButtonProps } from '@kbn/kibana-react-plugin/public'; -import { XYLayerConfig, AxesSettingsConfig } from '../types'; +import { + EuiIconAxisBottom, + EuiIconAxisLeft, + EuiIconAxisRight, + EuiIconAxisTop, +} from '@kbn/chart-icons'; +import { isHorizontalChart } from '../state_helpers'; import { ToolbarPopover, useDebouncedValue, @@ -26,11 +32,7 @@ import { RangeInputField, BucketAxisBoundsControl, } from '../../../shared_components'; -import { isHorizontalChart } from '../state_helpers'; -import { EuiIconAxisBottom } from '../../../assets/axis_bottom'; -import { EuiIconAxisLeft } from '../../../assets/axis_left'; -import { EuiIconAxisRight } from '../../../assets/axis_right'; -import { EuiIconAxisTop } from '../../../assets/axis_top'; +import { XYLayerConfig, AxesSettingsConfig } from '../types'; import { validateExtent } from '../axes_configuration'; import './axis_settings_popover.scss'; diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/layer_header.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/layer_header.tsx index 44d9f342cfcd7..d55aa0aa12133 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/layer_header.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/layer_header.tsx @@ -9,12 +9,11 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiIcon, EuiPopover, EuiSelectable, EuiText, EuiPopoverTitle } from '@elastic/eui'; import { ToolbarButton } from '@kbn/kibana-react-plugin/public'; +import { IconChartBarReferenceLine, IconChartBarAnnotations } from '@kbn/chart-icons'; import type { VisualizationLayerWidgetProps, VisualizationType } from '../../../types'; import { State, visualizationTypes, SeriesType } from '../types'; import { isHorizontalChart, isHorizontalSeries } from '../state_helpers'; import { StaticHeader } from '../../../shared_components'; -import { LensIconChartBarReferenceLine } from '../../../assets/chart_bar_reference_line'; -import { LensIconChartBarAnnotations } from '../../../assets/chart_bar_annotations'; import { updateLayer } from '.'; import { isAnnotationsLayer, isDataLayer, isReferenceLayer } from '../visualization_helpers'; @@ -34,7 +33,7 @@ export function LayerHeader(props: VisualizationLayerWidgetProps) { function ReferenceLayerHeader() { return ( { expect(points[0].coordinates).toEqual([lon, lat]); }); - it('Should convert runtime geo_point value', () => { - const points = []; - geoPointToGeometry(`${lat},${lon}`, points); - expect(points.length).toBe(1); - expect(points[0].type).toBe('Point'); - expect(points[0].coordinates).toEqual([lon, lat]); - }); - it('Should convert array of values', () => { const lat2 = 30; const lon2 = -60; diff --git a/x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.ts b/x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.ts index 964a88a8b1a93..9b03be8e7f8a0 100644 --- a/x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.ts +++ b/x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.ts @@ -129,7 +129,7 @@ export function hitsToGeoJson( // Parse geo_point fields API response export function geoPointToGeometry( - value: Point[] | Point | string | undefined, + value: Point[] | Point | undefined, accumulator: Geometry[] ): void { if (!value) { @@ -143,19 +143,6 @@ export function geoPointToGeometry( return; } - // runtime geo_point field returns value as "lat,lon" string instead of GeoJSON - // This is a workaround for a bug - https://github.com/elastic/elasticsearch/issues/85245 - if (typeof value === 'string') { - const commaSplit = value.split(','); - const lat = parseFloat(commaSplit[0]); - const lon = parseFloat(commaSplit[1]); - accumulator.push({ - type: GEO_JSON_TYPE.POINT, - coordinates: [lon, lat], - } as Point); - return; - } - // geo_point fields API returns GeoJSON accumulator.push(value as Point); } diff --git a/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts b/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts index 76dafc6a6c68e..90a29a0f72ee2 100644 --- a/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts +++ b/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts @@ -18,8 +18,8 @@ export function getField(indexPattern: DataView, fieldName: string): DataViewFie if (!field) { throw new Error( i18n.translate('xpack.maps.source.esSearch.fieldNotFoundMsg', { - defaultMessage: `Unable to find '{fieldName}' in index-pattern '{indexPatternTitle}'.`, - values: { fieldName, indexPatternTitle: indexPattern.title }, + defaultMessage: `Unable to find '{fieldName}' in index-pattern '{indexPatternName}'.`, + values: { fieldName, indexPatternName: indexPattern.getName() }, }) ); } diff --git a/x-pack/plugins/maps/public/actions/map_action_constants.ts b/x-pack/plugins/maps/public/actions/map_action_constants.ts index 62fed40a4171c..aabca948ec80a 100644 --- a/x-pack/plugins/maps/public/actions/map_action_constants.ts +++ b/x-pack/plugins/maps/public/actions/map_action_constants.ts @@ -30,6 +30,7 @@ export const SET_LAYER_STYLE_META = 'SET_LAYER_STYLE_META'; export const UPDATE_SOURCE_PROP = 'UPDATE_SOURCE_PROP'; export const SET_MOUSE_COORDINATES = 'SET_MOUSE_COORDINATES'; export const CLEAR_MOUSE_COORDINATES = 'CLEAR_MOUSE_COORDINATES'; +export const SET_EMBEDDABLE_SEARCH_CONTEXT = 'SET_EMBEDDABLE_SEARCH_CONTEXT'; export const SET_GOTO = 'SET_GOTO'; export const CLEAR_GOTO = 'CLEAR_GOTO'; export const TRACK_CURRENT_LAYER_STATE = 'TRACK_CURRENT_LAYER_STATE'; diff --git a/x-pack/plugins/maps/public/actions/map_actions.ts b/x-pack/plugins/maps/public/actions/map_actions.ts index f21f09a6cff3b..f122d664ecf66 100644 --- a/x-pack/plugins/maps/public/actions/map_actions.ts +++ b/x-pack/plugins/maps/public/actions/map_actions.ts @@ -43,6 +43,7 @@ import { MAP_EXTENT_CHANGED, MAP_READY, ROLLBACK_MAP_SETTINGS, + SET_EMBEDDABLE_SEARCH_CONTEXT, SET_GOTO, SET_MAP_INIT_ERROR, SET_MAP_SETTINGS, @@ -340,6 +341,19 @@ export function setQuery({ }; } +export function setEmbeddableSearchContext({ + query, + filters, +}: { + filters: Filter[]; + query?: Query; +}) { + return { + type: SET_EMBEDDABLE_SEARCH_CONTEXT, + embeddableSearchContext: { filters, query }, + }; +} + export function updateDrawState(drawState: DrawState | null) { return (dispatch: Dispatch) => { if (drawState !== null) { diff --git a/x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts b/x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts index 869c69229ebf1..1a6841ffa9e7e 100644 --- a/x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts +++ b/x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts @@ -83,7 +83,7 @@ export class AggField extends CountAggField { async getLabel(): Promise { return this._label ? this._label - : this._source.getAggLabel( + : await this._source.getAggLabel( this._aggType, this._esDocField ? await this._esDocField.getLabel() : '' ); diff --git a/x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts b/x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts index 16f7a7d09d28f..03ade37c3dbec 100644 --- a/x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts +++ b/x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts @@ -66,7 +66,7 @@ export class CountAggField implements IESAggField { } async getLabel(): Promise { - return this._label ? this._label : this._source.getAggLabel(AGG_TYPE.COUNT, ''); + return this._label ? this._label : await this._source.getAggLabel(AGG_TYPE.COUNT, ''); } isValid(): boolean { diff --git a/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts b/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts index 4566cf4a73f1c..3b6eff3313077 100644 --- a/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts +++ b/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts @@ -32,7 +32,7 @@ const mockEsAggSource = { getAggKey: (aggType: AGG_TYPE, fieldName: string) => { return 'agg_key'; }, - getAggLabel: (aggType: AGG_TYPE, fieldName: string) => { + getAggLabel: async (aggType: AGG_TYPE, fieldName: string) => { return 'agg_label'; }, getIndexPattern: async () => { 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 bc542bf891517..57dcd5631918c 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 @@ -57,7 +57,7 @@ export class PercentileAggField extends AggField implements IESAggField { } const suffix = getOrdinalSuffix(this._percentile); - return `${this._percentile}${suffix} ${this._source.getAggLabel( + return `${this._percentile}${suffix} ${await this._source.getAggLabel( this._getAggType(), this.getRootName() )}`; diff --git a/x-pack/plugins/maps/public/classes/joins/inner_join.test.js b/x-pack/plugins/maps/public/classes/joins/inner_join.test.js index 4e273f95515e4..f8ca092e9a164 100644 --- a/x-pack/plugins/maps/public/classes/joins/inner_join.test.js +++ b/x-pack/plugins/maps/public/classes/joins/inner_join.test.js @@ -15,7 +15,6 @@ const rightSource = { type: SOURCE_TYPES.ES_TERM_SOURCE, id: 'd3625663-5b34-4d50-a784-0d743f676a0c', indexPatternId: '90943e30-9a47-11e8-b64d-95841ca0b247', - indexPatternTitle: 'kibana_sample_data_logs', term: 'geo.dest', metrics: [{ type: 'count' }], }; 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 19d9567a3480a..e88cbaa0d6d87 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 @@ -37,7 +37,6 @@ export interface CreateRegionMapLayerDescriptorParams { termsSize?: number; colorSchema: string; indexPatternId?: string; - indexPatternTitle?: string; metricAgg: string; metricFieldName?: string; } @@ -65,7 +64,6 @@ export function createRegionMapLayerDescriptor({ termsSize, colorSchema, indexPatternId, - indexPatternTitle, metricAgg, metricFieldName, }: CreateRegionMapLayerDescriptorParams): LayerDescriptor | null { @@ -87,7 +85,6 @@ export function createRegionMapLayerDescriptor({ type: SOURCE_TYPES.ES_TERM_SOURCE, id: joinId, indexPatternId, - indexPatternTitle: indexPatternTitle ? indexPatternTitle : indexPatternId, term: termsFieldName, metrics: [metricsDescriptor], applyGlobalQuery: true, diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/bounds_data.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/bounds_data.ts index 7136c9d0c2235..d7382782d1af7 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/bounds_data.ts +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/bounds_data.ts @@ -39,6 +39,7 @@ export async function syncBoundsData({ query: dataFilters.query, timeFilters: dataFilters.timeFilters, timeslice: dataFilters.timeslice, + embeddableSearchContext: dataFilters.embeddableSearchContext, filters: dataFilters.filters, joinKeyFilter: dataFilters.joinKeyFilter, applyGlobalQuery: source.getApplyGlobalQuery(), diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.test.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.test.tsx index 5b91e5e49c514..b71fef484de01 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.test.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.test.tsx @@ -72,7 +72,6 @@ describe('cloneDescriptor', () => { right: { id: '557d0f15', indexPatternId: 'myIndexPattern', - indexPatternTitle: 'logs-*', metrics: [{ type: AGG_TYPE.COUNT }], term: 'myTermField', type: SOURCE_TYPES.ES_TERM_SOURCE, @@ -114,7 +113,6 @@ describe('cloneDescriptor', () => { right: { id: '557d0f15', indexPatternId: 'myIndexPattern', - indexPatternTitle: 'logs-*', term: 'myTermField', type: 'joinSource', } as unknown as ESTermSourceDescriptor, diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts b/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts index 36e07d7383d18..2cbf6d3000b9a 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts +++ b/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts @@ -38,14 +38,12 @@ function createChoroplethLayerDescriptor({ sourceDescriptor, leftField, rightIndexPatternId, - rightIndexPatternTitle, rightTermField, layerType, }: { sourceDescriptor: EMSFileSourceDescriptor | ESSearchSourceDescriptor; leftField: string; rightIndexPatternId: string; - rightIndexPatternTitle: string; rightTermField: string; layerType: LAYER_TYPE.GEOJSON_VECTOR | LAYER_TYPE.MVT_VECTOR; }) { @@ -98,7 +96,6 @@ function createChoroplethLayerDescriptor({ type: SOURCE_TYPES.ES_TERM_SOURCE, id: joinId, indexPatternId: rightIndexPatternId, - indexPatternTitle: rightIndexPatternTitle, term: rightTermField, metrics: [metricsDescriptor], applyGlobalQuery: true, @@ -125,13 +122,11 @@ export function createEmsChoroplethLayerDescriptor({ leftEmsFileId, leftEmsField, rightIndexPatternId, - rightIndexPatternTitle, rightTermField, }: { leftEmsFileId: string; leftEmsField: string; rightIndexPatternId: string; - rightIndexPatternTitle: string; rightTermField: string; }) { return createChoroplethLayerDescriptor({ @@ -141,7 +136,6 @@ export function createEmsChoroplethLayerDescriptor({ }), leftField: leftEmsField, rightIndexPatternId, - rightIndexPatternTitle, rightTermField, layerType: LAYER_TYPE.GEOJSON_VECTOR, }); @@ -152,14 +146,12 @@ export function createEsChoroplethLayerDescriptor({ leftGeoField, leftJoinField, rightIndexPatternId, - rightIndexPatternTitle, rightTermField, }: { leftIndexPatternId: string; leftGeoField: string; leftJoinField: string; rightIndexPatternId: string; - rightIndexPatternTitle: string; rightTermField: string; }) { return createChoroplethLayerDescriptor({ @@ -174,7 +166,6 @@ export function createEsChoroplethLayerDescriptor({ }), leftField: leftJoinField, rightIndexPatternId, - rightIndexPatternTitle, rightTermField, layerType: LAYER_TYPE.MVT_VECTOR, }); diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.tsx b/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.tsx index 4edf85bc922d1..5fef8dd28ceb1 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.tsx +++ b/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.tsx @@ -66,7 +66,6 @@ interface State { leftEmsJoinField: string | null; leftElasticsearchJoinField: string | null; rightIndexPatternId: string; - rightIndexPatternTitle: string | null; rightTermsFields: DataViewField[]; rightJoinField: string | null; } @@ -85,7 +84,6 @@ export class LayerTemplate extends Component { leftEmsJoinField: null, leftElasticsearchJoinField: null, rightIndexPatternId: '', - rightIndexPatternTitle: null, rightTermsFields: [], rightJoinField: null, }; @@ -99,7 +97,7 @@ export class LayerTemplate extends Component { } _loadRightFields = async (indexPatternId: string) => { - this.setState({ rightTermsFields: [], rightIndexPatternTitle: null }); + this.setState({ rightTermsFields: [] }); let indexPattern; try { @@ -116,7 +114,6 @@ export class LayerTemplate extends Component { this.setState({ rightTermsFields: getTermsFields(indexPattern.fields), - rightIndexPatternTitle: indexPattern.title, }); }; @@ -265,14 +262,12 @@ export class LayerTemplate extends Component { leftGeoField: this.state.leftGeoField!, leftJoinField: this.state.leftElasticsearchJoinField!, rightIndexPatternId: this.state.rightIndexPatternId, - rightIndexPatternTitle: this.state.rightIndexPatternTitle!, rightTermField: this.state.rightJoinField!, }) : createEmsChoroplethLayerDescriptor({ leftEmsFileId: this.state.leftEmsFileId!, leftEmsField: this.state.leftEmsJoinField!, rightIndexPatternId: this.state.rightIndexPatternId, - rightIndexPatternTitle: this.state.rightIndexPatternTitle!, rightTermField: this.state.rightJoinField!, }); diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.test.ts b/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.test.ts index 771cf55ec25d3..7aaea96a06aed 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.test.ts +++ b/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.test.ts @@ -55,7 +55,6 @@ describe('createLayerDescriptor', () => { applyGlobalTime: true, id: '12345', indexPatternId: 'apm_static_index_pattern_id', - indexPatternTitle: 'traces-apm*,logs-apm*,metrics-apm*,apm-*', metrics: [ { field: 'transaction.duration.us', diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.ts b/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.ts index 26a9f14b8160f..b8536d8970939 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.ts +++ b/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.ts @@ -173,7 +173,6 @@ export function createLayerDescriptor({ type: SOURCE_TYPES.ES_TERM_SOURCE, id: joinId, indexPatternId: APM_INDEX_PATTERN_ID, - indexPatternTitle: APM_INDEX_PATTERN_TITLE, // TODO look up from APM_OSS.indexPattern term: 'client.geo.country_iso_code', metrics: [metricsDescriptor], whereQuery: apmSourceQuery, diff --git a/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts b/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts index fce9293cf9f02..42b9c0ed73c77 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts @@ -21,7 +21,7 @@ export const DEFAULT_METRIC = { type: AGG_TYPE.COUNT }; export interface IESAggSource extends IESSource { getAggKey(aggType: AGG_TYPE, fieldName: string): string; - getAggLabel(aggType: AGG_TYPE, fieldLabel: string): string; + getAggLabel(aggType: AGG_TYPE, fieldLabel: string): Promise; getMetricFields(): IESAggField[]; getMetricFieldForName(fieldName: string): IESAggField | null; getValueAggsDsl(indexPattern: DataView): { [key: string]: unknown }; @@ -88,7 +88,7 @@ export abstract class AbstractESAggSource extends AbstractESSource implements IE }); } - getAggLabel(aggType: AGG_TYPE, fieldLabel: string): string { + async getAggLabel(aggType: AGG_TYPE, fieldLabel: string): Promise { switch (aggType) { case AGG_TYPE.COUNT: return COUNT_PROP_LABEL; 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 37b764bf6dbdc..b0a230bebc3cd 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 @@ -142,14 +142,6 @@ export class ESGeoGridSource extends AbstractESAggSource implements IMvtVectorSo } async getImmutableProperties(): Promise { - let indexPatternName = this.getIndexPatternId(); - try { - const indexPattern = await this.getIndexPattern(); - indexPatternName = indexPattern.title; - } catch (error) { - // ignore error, title will just default to id - } - return [ { label: getDataSourceLabel(), @@ -157,7 +149,7 @@ export class ESGeoGridSource extends AbstractESAggSource implements IMvtVectorSo }, { label: getDataViewLabel(), - value: indexPatternName, + value: await this.getDisplayName(), }, { label: i18n.translate('xpack.maps.source.esGrid.geospatialFieldLabel', { diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx index 4bb23cfb7e55b..78aae064a6555 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx @@ -109,14 +109,6 @@ export class ESGeoLineSource extends AbstractESAggSource { } async getImmutableProperties(): Promise { - let indexPatternTitle = this.getIndexPatternId(); - try { - const indexPattern = await this.getIndexPattern(); - indexPatternTitle = indexPattern.title; - } catch (error) { - // ignore error, title will just default to id - } - return [ { label: getDataSourceLabel(), @@ -124,7 +116,7 @@ export class ESGeoLineSource extends AbstractESAggSource { }, { label: getDataViewLabel(), - value: indexPatternTitle, + value: await this.getDisplayName(), }, { label: i18n.translate('xpack.maps.source.esGeoLine.geospatialFieldLabel', { diff --git a/x-pack/plugins/maps/public/classes/sources/es_pew_pew_source/es_pew_pew_source.tsx b/x-pack/plugins/maps/public/classes/sources/es_pew_pew_source/es_pew_pew_source.tsx index 910181d6a2868..8e9f0aabf3070 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_pew_pew_source/es_pew_pew_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_pew_pew_source/es_pew_pew_source.tsx @@ -96,14 +96,6 @@ export class ESPewPewSource extends AbstractESAggSource { } async getImmutableProperties() { - let indexPatternTitle = this.getIndexPatternId(); - try { - const indexPattern = await this.getIndexPattern(); - indexPatternTitle = indexPattern.title; - } catch (error) { - // ignore error, title will just default to id - } - return [ { label: getDataSourceLabel(), @@ -111,7 +103,7 @@ export class ESPewPewSource extends AbstractESAggSource { }, { label: getDataViewLabel(), - value: indexPatternTitle, + value: await this.getDisplayName(), }, { label: i18n.translate('xpack.maps.source.pewPew.sourceGeoFieldLabel', { diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap b/x-pack/plugins/maps/public/classes/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap index 1edbdec242722..c99d67ffd5a30 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap @@ -94,12 +94,10 @@ exports[`should enable sort order select when sort field provided 1`] = ` clusteringDisabledReason={null} filterByMapBounds={true} indexPatternId="indexPattern1" - mvtDisabledReason={null} numberOfJoins={0} onChange={[Function]} scalingType="LIMIT" supportsClustering={false} - supportsMvt={true} /> { ? { indexPatternId: indexPattern.id, geoField: geoFieldName, - scalingType: field && field.isRuntimeField ? SCALING_TYPES.LIMIT : SCALING_TYPES.MVT, + scalingType: SCALING_TYPES.MVT, } : null; const isPointsOnly = field ? field.type === 'geo_point' : false; 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 b99903423376e..f55f5be747dcd 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 @@ -220,15 +220,12 @@ export class ESSearchSource extends AbstractESSource implements IMvtVectorSource } async getImmutableProperties(): Promise { - let indexPatternName = this.getIndexPatternId(); let geoFieldType = ''; try { - const indexPattern = await this.getIndexPattern(); - indexPatternName = indexPattern.title; const geoField = await this._getGeoField(); geoFieldType = geoField.type; } catch (error) { - // ignore error, title will just default to id + // ignore error, geoFieldType will just be blank } return [ @@ -238,7 +235,7 @@ export class ESSearchSource extends AbstractESSource implements IMvtVectorSource }, { label: getDataViewLabel(), - value: indexPatternName, + value: await this.getDisplayName(), }, { label: i18n.translate('xpack.maps.source.esSearch.geoFieldLabel', { diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/update_source_editor.tsx b/x-pack/plugins/maps/public/classes/sources/es_search_source/update_source_editor.tsx index 2c8dca0f1cdf6..51ebe8cc9e042 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/update_source_editor.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/update_source_editor.tsx @@ -47,8 +47,6 @@ interface State { sortFields: DataViewField[] | undefined; supportsClustering: boolean; clusteringDisabledReason: string | null; - supportsMvt: boolean; - mvtDisabledReason: string | null; } export class UpdateSourceEditor extends Component { @@ -58,8 +56,6 @@ export class UpdateSourceEditor extends Component { sortFields: undefined, supportsClustering: false, clusteringDisabledReason: null, - supportsMvt: true, - mvtDisabledReason: null, }; componentDidMount() { @@ -111,13 +107,6 @@ export class UpdateSourceEditor extends Component { this.setState({ supportsClustering: supportsGeoTileAgg(geoField), clusteringDisabledReason: getGeoTileAggNotSupportedReason(geoField), - supportsMvt: !geoField.isRuntimeField, - mvtDisabledReason: geoField.isRuntimeField - ? i18n.translate('xpack.maps.source.esSearch.mvtDisableReason', { - defaultMessage: 'Vector tile API does not support runtime {type} field', - values: { type: geoField.type }, - }) - : null, sourceFields, sortFields: indexPattern.fields.filter( (field) => field.sortable && !indexPatterns.isNestedField(field) @@ -228,8 +217,6 @@ export class UpdateSourceEditor extends Component { scalingType={this.props.scalingType} supportsClustering={this.state.supportsClustering} clusteringDisabledReason={this.state.clusteringDisabledReason} - supportsMvt={this.state.supportsMvt} - mvtDisabledReason={this.state.mvtDisabledReason} numberOfJoins={this.props.numberOfJoins} /> 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 0c77be62179c2..f8c5951e95e04 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,7 +34,6 @@ exports[`scaling form should disable clusters option when clustering is not supp
{ _renderContent() { return (
- +
{this.props.mvtOptionLabel} (Default)
diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.test.tsx b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.test.tsx index 65ce7071df048..38137ffcd72df 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.test.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.test.tsx @@ -25,7 +25,6 @@ const defaultProps = { onChange: () => {}, scalingType: SCALING_TYPES.LIMIT, supportsClustering: true, - supportsMvt: true, termFields: [], numberOfJoins: 0, }; diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.tsx b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.tsx index fd0c23a98df45..ccd3b3913a085 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.tsx @@ -35,8 +35,6 @@ interface Props { scalingType: SCALING_TYPES; supportsClustering: boolean; clusteringDisabledReason?: string | null; - supportsMvt: boolean; - mvtDisabledReason?: string | null; numberOfJoins: number; } @@ -188,26 +186,6 @@ export class ScalingForm extends Component { ); } - _renderMvtRadio() { - const radio = ( - this._onScalingTypeSelect(SCALING_TYPES.MVT)} - disabled={!this.props.supportsMvt} - /> - ); - - return this.props.mvtDisabledReason ? ( - - {radio} - - ) : ( - radio - ); - } - _renderClusteringRadio() { const clusteringRadio = ( {
- {this._renderMvtRadio()} + this._onScalingTypeSelect(SCALING_TYPES.MVT)} + /> {this._renderClusteringRadio()} { try { const indexPattern = await this.getIndexPattern(); - return indexPattern.title; + return indexPattern.getName(); } catch (error) { // Unable to load index pattern, just return id as display name return this.getIndexPatternId(); 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 362b2b341714f..c5bce9de0b033 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 @@ -9,7 +9,6 @@ import { ESTermSource, extractPropertiesMap } from './es_term_source'; jest.mock('../../layers/vector_layer', () => {}); -const indexPatternTitle = 'myIndex'; const termFieldName = 'myTermField'; const sumFieldName = 'myFieldGettingSummed'; const metricExamples = [ @@ -33,19 +32,17 @@ describe('getMetricFields', () => { it('should override name and label of count metric', async () => { const source = new ESTermSource({ id: '1234', - indexPatternTitle: indexPatternTitle, term: termFieldName, indexPatternId: 'foobar', }); const metrics = source.getMetricFields(); expect(metrics[0].getName()).toEqual('__kbnjoin__count__1234'); - expect(await metrics[0].getLabel()).toEqual('Count of myIndex'); + expect(await metrics[0].getLabel()).toEqual('Count of foobar'); }); it('should override name and label of sum metric', async () => { const source = new ESTermSource({ id: '1234', - indexPatternTitle: indexPatternTitle, term: termFieldName, metrics: metricExamples, indexPatternId: 'foobar', @@ -54,7 +51,7 @@ describe('getMetricFields', () => { expect(metrics[0].getName()).toEqual('__kbnjoin__sum_of_myFieldGettingSummed__1234'); expect(await metrics[0].getLabel()).toEqual('my custom label'); expect(metrics[1].getName()).toEqual('__kbnjoin__count__1234'); - expect(await metrics[1].getLabel()).toEqual('Count of myIndex'); + expect(await metrics[1].getLabel()).toEqual('Count of foobar'); }); }); @@ -114,7 +111,6 @@ 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, 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 5447910dc524a..71ce42be22ab0 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 @@ -63,9 +63,6 @@ export class ESTermSource extends AbstractESAggSource implements ITermJoinSource } return { ...normalizedDescriptor, - indexPatternTitle: descriptor.indexPatternTitle - ? descriptor.indexPatternTitle - : descriptor.indexPatternId, term: descriptor.term!, type: SOURCE_TYPES.ES_TERM_SOURCE, }; @@ -109,11 +106,18 @@ export class ESTermSource extends AbstractESAggSource implements ITermJoinSource }); } - getAggLabel(aggType: AGG_TYPE, fieldLabel: string): string { + async getAggLabel(aggType: AGG_TYPE, fieldLabel: string): Promise { + let indexPatternLabel: string | undefined; + try { + const indexPattern = await this.getIndexPattern(); + indexPatternLabel = indexPattern.getName(); + } catch (error) { + indexPatternLabel = this._descriptor.indexPatternId; + } return aggType === AGG_TYPE.COUNT ? i18n.translate('xpack.maps.source.esJoin.countLabel', { - defaultMessage: `Count of {indexPatternTitle}`, - values: { indexPatternTitle: this._descriptor.indexPatternTitle }, + defaultMessage: `Count of {indexPatternLabel}`, + values: { indexPatternLabel }, }) : super.getAggLabel(aggType, fieldLabel); } @@ -145,14 +149,14 @@ export class ESTermSource extends AbstractESAggSource implements ITermJoinSource const rawEsData = await this._runEsQuery({ requestId: this.getId(), - requestName: `${this._descriptor.indexPatternTitle}.${this._termField.getName()}`, + requestName: `${indexPattern.getName()}.${this._termField.getName()}`, searchSource, registerCancelCallback, requestDescription: i18n.translate('xpack.maps.source.esJoin.joinDescription', { defaultMessage: `Elasticsearch terms aggregation request, left source: {leftSource}, right source: {rightSource}`, values: { leftSource: `${leftSourceName}:${leftFieldName}`, - rightSource: `${this._descriptor.indexPatternTitle}:${this._termField.getName()}`, + rightSource: `${indexPattern.getName()}:${this._termField.getName()}`, }, }), searchSessionId: searchFilters.searchSessionId, 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 64082a85df6b7..0620386fda4c1 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 @@ -53,6 +53,10 @@ export interface BoundsRequestMeta { applyGlobalTime: boolean; filters: Filter[]; query?: Query; + embeddableSearchContext?: { + query?: Query; + filters: Filter[]; + }; sourceQuery?: Query; timeFilters: TimeRange; timeslice?: Timeslice; 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 de9d74f68f965..41903e8accafc 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 @@ -48,7 +48,6 @@ exports[`Should render join editor 1`] = ` "right": Object { "id": "673ff994-fc75-4c67-909b-69fcb0e1060e", "indexPatternId": "abcde", - "indexPatternTitle": "kibana_sample_data_logs", "metrics": Array [ Object { "label": "web logs count", diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.test.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.test.tsx index cb007110f7d35..1bfe40b555261 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.test.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.test.tsx @@ -37,7 +37,6 @@ const defaultProps = { leftField: 'iso2', right: { id: '673ff994-fc75-4c67-909b-69fcb0e1060e', - indexPatternTitle: 'kibana_sample_data_logs', term: 'geo.src', indexPatternId: 'abcde', metrics: [ diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx index bbfc9bbb0f302..1eb23dc207cd4 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx @@ -95,13 +95,7 @@ export class Join extends Component { }); }; - _onRightSourceChange = ({ - indexPatternId, - indexPatternTitle, - }: { - indexPatternId: string; - indexPatternTitle: string; - }) => { + _onRightSourceChange = (indexPatternId: string) => { this.setState({ rightFields: [], loadError: undefined, @@ -113,7 +107,6 @@ export class Join extends Component { right: { ...restOfRight, indexPatternId, - indexPatternTitle, type: SOURCE_TYPES.ES_TERM_SOURCE, } as ESTermSourceDescriptor, }); @@ -183,9 +176,7 @@ export class Join extends Component { const { join, onRemove, leftFields, leftSourceName } = this.props; const { rightFields, indexPattern } = this.state; const right = _.get(join, 'right', {}) as ESTermSourceDescriptor; - const rightSourceName = right.indexPatternTitle - ? right.indexPatternTitle - : right.indexPatternId; + const rightSourceName = indexPattern ? indexPattern.getName() : right.indexPatternId; const isJoinConfigComplete = join.leftField && right.indexPatternId && right.term; let metricsExpression; diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_documentation_popover.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_documentation_popover.tsx index 1799b7264611d..1df70f334a4fd 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_documentation_popover.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_documentation_popover.tsx @@ -34,7 +34,7 @@ export class JoinDocumentationPopover extends Component<{}, State> { _renderContent() { return (
- +

void; + onRightSourceChange: (indexPatternId: string) => void; // Right field props rightValue: string; @@ -81,20 +72,12 @@ export class JoinExpression extends Component { }); }; - _onRightSourceChange = async (indexPatternId?: string) => { + _onRightSourceChange = (indexPatternId?: string) => { if (!indexPatternId || indexPatternId.length === 0) { return; } - try { - const indexPattern = await getIndexPatternService().get(indexPatternId); - this.props.onRightSourceChange({ - indexPatternId, - indexPatternTitle: indexPattern.title, - }); - } catch (err) { - // do not call onChange with when unable to get indexPatternId - } + this.props.onRightSourceChange(indexPatternId); }; _onLeftFieldChange = (selectedFields: Array>) => { diff --git a/x-pack/plugins/maps/public/connected_components/toolbar_overlay/tools_control/tools_control.test.tsx b/x-pack/plugins/maps/public/connected_components/toolbar_overlay/tools_control/tools_control.test.tsx index 4601b5c569290..443dd7b47a069 100644 --- a/x-pack/plugins/maps/public/connected_components/toolbar_overlay/tools_control/tools_control.test.tsx +++ b/x-pack/plugins/maps/public/connected_components/toolbar_overlay/tools_control/tools_control.test.tsx @@ -12,14 +12,6 @@ import { ToolsControl } from './tools_control'; const defaultProps = { initiateDraw: () => {}, cancelDraw: () => {}, - geoFields: [ - { - geoFieldName: 'location', - geoFieldType: 'geo_point', - indexPatternTitle: 'my_index', - indexPatternId: '1', - }, - ], filterModeActive: false, activateDrawFilterMode: () => {}, deactivateDrawMode: () => {}, diff --git a/x-pack/plugins/maps/public/embeddable/map_component.tsx b/x-pack/plugins/maps/public/embeddable/map_component.tsx index 4709255927734..bb331ccf38c0e 100644 --- a/x-pack/plugins/maps/public/embeddable/map_component.tsx +++ b/x-pack/plugins/maps/public/embeddable/map_component.tsx @@ -16,6 +16,7 @@ import type { LazyLoadedMapModules } from '../lazy_load_bundle'; import { lazyLoadMapModules } from '../lazy_load_bundle'; interface Props { + title: string; filters?: Filter[]; query?: Query; timeRange?: TimeRange; @@ -81,7 +82,7 @@ export class MapComponent extends Component { { id: uuid(), attributes: { - title: '', + title: this.props.title, layerListJSON: JSON.stringify([ mapModules.createBasemapLayerDescriptor(), ...this.props.getLayerDescriptors({ diff --git a/x-pack/plugins/maps/public/embeddable/map_embeddable.tsx b/x-pack/plugins/maps/public/embeddable/map_embeddable.tsx index d271ee053d8c7..76f6dbbb15133 100644 --- a/x-pack/plugins/maps/public/embeddable/map_embeddable.tsx +++ b/x-pack/plugins/maps/public/embeddable/map_embeddable.tsx @@ -36,6 +36,7 @@ import { setReadOnly, updateLayerById, setGotoWithCenter, + setEmbeddableSearchContext, } from '../actions'; import { getIsLayerTOCOpen, getOpenTOCDetails } from '../selectors/ui_selectors'; import { @@ -48,6 +49,7 @@ import { import { areLayersLoaded, getGeoFieldNames, + getEmbeddableSearchContext, getLayerList, getGoto, getMapCenter, @@ -194,6 +196,21 @@ export class MapEmbeddable forceRefresh: false, }); + const mapStateJSON = this._savedMap.getAttributes().mapStateJSON; + if (mapStateJSON) { + try { + const mapState = JSON.parse(mapStateJSON); + store.dispatch( + setEmbeddableSearchContext({ + filters: mapState.filters ? mapState.filters : [], + query: mapState.query, + }) + ); + } catch (e) { + // ignore malformed mapStateJSON, not a critical error for viewing map - map will just use defaults + } + } + this._unsubscribeFromStore = store.subscribe(() => { this._handleStoreChanges(); }); @@ -249,20 +266,18 @@ export class MapEmbeddable return this._isInitialized ? this._savedMap.getAttributes().description : ''; } - /** - * TODO: Implement this function once https://github.com/elastic/kibana/issues/91282 is resolved - * @returns [] - */ public async getFilters() { - return []; + const embeddableSearchContext = getEmbeddableSearchContext( + this._savedMap.getStore().getState() + ); + return embeddableSearchContext ? embeddableSearchContext.filters : []; } - /** - * TODO: Implement this function once https://github.com/elastic/kibana/issues/91282 is resolved - * @returns undefined - */ public async getQuery() { - return undefined; + const embeddableSearchContext = getEmbeddableSearchContext( + this._savedMap.getStore().getState() + ); + return embeddableSearchContext?.query; } public supportedTriggers(): string[] { diff --git a/x-pack/plugins/maps/public/lazy_load_bundle/index.ts b/x-pack/plugins/maps/public/lazy_load_bundle/index.ts index cbd1b3aa4b4c8..cdf61a6ab9173 100644 --- a/x-pack/plugins/maps/public/lazy_load_bundle/index.ts +++ b/x-pack/plugins/maps/public/lazy_load_bundle/index.ts @@ -51,7 +51,6 @@ export interface LazyLoadedMapModules { termsSize, colorSchema, indexPatternId, - indexPatternTitle, metricAgg, metricFieldName, }: CreateRegionMapLayerDescriptorParams) => LayerDescriptor | null; diff --git a/x-pack/plugins/maps/public/legacy_visualizations/index.ts b/x-pack/plugins/maps/public/legacy_visualizations/index.ts index a01e0ebefb5ad..f6e154949390e 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/index.ts +++ b/x-pack/plugins/maps/public/legacy_visualizations/index.ts @@ -7,3 +7,4 @@ export { createRegionMapFn, regionMapRenderer, regionMapVisType } from './region_map'; export { createTileMapFn, tileMapRenderer, tileMapVisType } from './tile_map'; +export { isLegacyMap } from './is_legacy_map'; diff --git a/x-pack/plugins/maps/public/legacy_visualizations/is_legacy_map.ts b/x-pack/plugins/maps/public/legacy_visualizations/is_legacy_map.ts new file mode 100644 index 0000000000000..2a5fc483027e7 --- /dev/null +++ b/x-pack/plugins/maps/public/legacy_visualizations/is_legacy_map.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 { Embeddable } from '@kbn/embeddable-plugin/public'; +import type { VisualizeEmbeddable } from '@kbn/visualizations-plugin/public'; + +export function isLegacyMap(embeddable: Embeddable) { + return ( + embeddable.type === 'visualization' && + typeof (embeddable as VisualizeEmbeddable).getVis === 'function' && + ['region_map', 'tile_map'].includes((embeddable as VisualizeEmbeddable).getVis()?.type?.name) + ); +} diff --git a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx index 2334b9af1996c..b6945995da9d9 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx @@ -36,6 +36,7 @@ function RegionMapVisualization(props: Props) { } return ( ) { leftFieldName: vis.params.selectedLayer.isEMS ? vis.params.selectedJoinField.name : undefined, colorSchema: vis.params.colorSchema, indexPatternId: vis.data.indexPattern?.id, - indexPatternTitle: vis.data.indexPattern?.title, metricAgg: 'count', }; diff --git a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx index fd5f916baf4c6..97a3609d765a4 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx @@ -36,6 +36,7 @@ function TileMapVisualization(props: Props) { } return ( & { timeslice?: Timeslice; query?: Query; filters: Filter[]; + embeddableSearchContext?: { + query?: Query; + filters: Filter[]; + }; drawState?: DrawState; editState?: EditState; searchSessionId?: string; diff --git a/x-pack/plugins/maps/public/selectors/map_selectors.test.ts b/x-pack/plugins/maps/public/selectors/map_selectors.test.ts index baca2d79b833d..584bdd0160b8c 100644 --- a/x-pack/plugins/maps/public/selectors/map_selectors.test.ts +++ b/x-pack/plugins/maps/public/selectors/map_selectors.test.ts @@ -57,6 +57,7 @@ describe('getDataFilters', () => { const timeFilters = { to: '2001-01-01', from: '2001-12-31' }; const timeslice = undefined; const query = undefined; + const embeddableSearchContext = undefined; const filters: Filter[] = []; const searchSessionId = '12345'; const searchSessionMapBuffer = { @@ -76,6 +77,7 @@ describe('getDataFilters', () => { timeslice, query, filters, + embeddableSearchContext, searchSessionId, searchSessionMapBuffer, isReadOnly @@ -92,6 +94,7 @@ describe('getDataFilters', () => { timeslice, query, filters, + embeddableSearchContext, searchSessionId, undefined, isReadOnly diff --git a/x-pack/plugins/maps/public/selectors/map_selectors.ts b/x-pack/plugins/maps/public/selectors/map_selectors.ts index a069b07d1f2c6..8adb3f8f927ab 100644 --- a/x-pack/plugins/maps/public/selectors/map_selectors.ts +++ b/x-pack/plugins/maps/public/selectors/map_selectors.ts @@ -198,6 +198,9 @@ export const getQuery = ({ map }: MapStoreState): Query | undefined => map.mapSt export const getFilters = ({ map }: MapStoreState): Filter[] => map.mapState.filters; +export const getEmbeddableSearchContext = ({ map }: MapStoreState) => + map.mapState.embeddableSearchContext; + export const getSearchSessionId = ({ map }: MapStoreState): string | undefined => map.mapState.searchSessionId; @@ -239,6 +242,7 @@ export const getDataFilters = createSelector( getTimeslice, getQuery, getFilters, + getEmbeddableSearchContext, getSearchSessionId, getSearchSessionMapBuffer, getIsReadOnly, @@ -250,6 +254,7 @@ export const getDataFilters = createSelector( timeslice, query, filters, + embeddableSearchContext, searchSessionId, searchSessionMapBuffer, isReadOnly @@ -262,6 +267,7 @@ export const getDataFilters = createSelector( timeslice, query, filters, + embeddableSearchContext, searchSessionId, isReadOnly, }; diff --git a/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent_action.tsx b/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent_action.tsx index b9d70bf4afbf3..c2183774cf677 100644 --- a/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent_action.tsx +++ b/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent_action.tsx @@ -10,6 +10,7 @@ import { i18n } from '@kbn/i18n'; import { Embeddable, EmbeddableInput } from '@kbn/embeddable-plugin/public'; import { createReactOverlays } from '@kbn/kibana-react-plugin/public'; import { createAction } from '@kbn/ui-actions-plugin/public'; +import { isLegacyMap } from '../legacy_visualizations'; import { MAP_SAVED_OBJECT_TYPE } from '../../common/constants'; import { getCore } from '../kibana_services'; @@ -58,7 +59,10 @@ export const filterByMapExtentAction = createAction { - return embeddable.type === MAP_SAVED_OBJECT_TYPE && !embeddable.getInput().disableTriggers; + return ( + (embeddable.type === MAP_SAVED_OBJECT_TYPE || isLegacyMap(embeddable)) && + !embeddable.getInput().disableTriggers + ); }, execute: async (context: FilterByMapExtentActionContext) => { const { FilterByMapExtentModal } = await import('./filter_by_map_extent_modal'); diff --git a/x-pack/plugins/maps/public/trigger_actions/synchronize_movement_action.tsx b/x-pack/plugins/maps/public/trigger_actions/synchronize_movement_action.tsx index e3404c628a54f..7116e55fd521d 100644 --- a/x-pack/plugins/maps/public/trigger_actions/synchronize_movement_action.tsx +++ b/x-pack/plugins/maps/public/trigger_actions/synchronize_movement_action.tsx @@ -11,6 +11,7 @@ import { createReactOverlays } from '@kbn/kibana-react-plugin/public'; import { Embeddable, EmbeddableInput } from '@kbn/embeddable-plugin/public'; import { createAction } from '@kbn/ui-actions-plugin/public'; import type { Embeddable as LensEmbeddable } from '@kbn/lens-plugin/public'; +import { isLegacyMap } from '../legacy_visualizations'; import { MAP_SAVED_OBJECT_TYPE } from '../../common/constants'; import { getCore } from '../kibana_services'; @@ -52,6 +53,10 @@ export const synchronizeMovementAction = createAction { diff --git a/x-pack/plugins/maps/tsconfig.json b/x-pack/plugins/maps/tsconfig.json index 57cc09dec4b16..ee28c2be8d31c 100644 --- a/x-pack/plugins/maps/tsconfig.json +++ b/x-pack/plugins/maps/tsconfig.json @@ -32,7 +32,6 @@ { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../../src/plugins/shared_ux/tsconfig.json" }, { "path": "../../../src/plugins/screenshot_mode/tsconfig.json" }, { "path": "../cloud/tsconfig.json" }, { "path": "../features/tsconfig.json" }, diff --git a/x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx b/x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx index d5b31b418e346..b721608d53f7e 100644 --- a/x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx +++ b/x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx @@ -122,11 +122,14 @@ const Tooltip: FC<{ service: ChartTooltipService }> = React.memo(({ service }) = return ( = ({ children }) => { const { setHeaderActionMenu } = useContext(MlPageControlsContext); - const portalNode = useMemo(() => createPortalNode(), []); + const portalNode = useMemo(() => createHtmlPortalNode(), []); useEffect(() => { if (!setHeaderActionMenu) { diff --git a/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx b/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx index 90dd95dbafb71..bd12a120420c2 100644 --- a/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx +++ b/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx @@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n'; import { Redirect, Route, Switch } from 'react-router-dom'; import type { AppMountParameters } from '@kbn/core/public'; import { KibanaPageTemplate, RedirectAppLinks } from '@kbn/kibana-react-plugin/public'; -import { createPortalNode, PortalNode } from 'react-reverse-portal'; +import { createHtmlPortalNode, HtmlPortalNode } from 'react-reverse-portal'; import { MlPageHeaderRenderer } from '../page_header/page_header'; import { useSideNavItems } from './side_nav'; import * as routes from '../../routing/routes'; @@ -23,13 +23,13 @@ import { useActiveRoute } from '../../routing/use_active_route'; import { useDocTitle } from '../../routing/use_doc_title'; export const MlPageControlsContext = createContext<{ - headerPortal: PortalNode; + headerPortal: HtmlPortalNode; setHeaderActionMenu?: AppMountParameters['setHeaderActionMenu']; setIsHeaderMounted: (v: boolean) => void; isHeaderMounted: boolean; }>({ setHeaderActionMenu: () => {}, - headerPortal: createPortalNode(), + headerPortal: createHtmlPortalNode(), isHeaderMounted: false, setIsHeaderMounted: () => {}, }); @@ -46,7 +46,7 @@ export const MlPage: FC<{ pageDeps: PageDependencies }> = React.memo(({ pageDeps }, } = useMlKibana(); - const headerPortalNode = useMemo(() => createPortalNode(), []); + const headerPortalNode = useMemo(() => createHtmlPortalNode(), []); const [isHeaderMounted, setIsHeaderMounted] = useState(false); const routeList = useMemo( @@ -114,7 +114,7 @@ interface CommonPageWrapperProps { setIsHeaderMounted: (v: boolean) => void; pageDeps: PageDependencies; routeList: MlRoute[]; - headerPortal: PortalNode; + headerPortal: HtmlPortalNode; } const CommonPageWrapper: FC = React.memo(({ pageDeps, routeList }) => { diff --git a/x-pack/plugins/monitoring/public/application/hooks/use_breadcrumbs.ts b/x-pack/plugins/monitoring/public/application/hooks/use_breadcrumbs.ts index 95cae1720fd07..7654e2d734e4c 100644 --- a/x-pack/plugins/monitoring/public/application/hooks/use_breadcrumbs.ts +++ b/x-pack/plugins/monitoring/public/application/hooks/use_breadcrumbs.ts @@ -301,4 +301,4 @@ export const useBreadcrumbs = ({ history }: { history: History }) => { }; }; -export const BreadcrumbContainer = createContainer(useBreadcrumbs); +export const [BreadcrumbContainer, useBreadcrumbContainerContext] = createContainer(useBreadcrumbs); diff --git a/x-pack/plugins/monitoring/public/application/hooks/use_charts.tsx b/x-pack/plugins/monitoring/public/application/hooks/use_charts.tsx index c37fae742d0ca..f456b62312ec6 100644 --- a/x-pack/plugins/monitoring/public/application/hooks/use_charts.tsx +++ b/x-pack/plugins/monitoring/public/application/hooks/use_charts.tsx @@ -5,15 +5,15 @@ * 2.0. */ import moment from 'moment'; -import { useContext, useState, useEffect, useRef } from 'react'; +import { useState, useEffect, useRef } from 'react'; import { useHistory } from 'react-router-dom'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { MonitoringTimeContainer } from './use_monitoring_time'; +import { useMonitoringTimeContainerContext } from './use_monitoring_time'; export function useCharts() { const { services } = useKibana<{ data: any }>(); const history = useHistory(); - const { handleTimeChange } = useContext(MonitoringTimeContainer.Context); + const { handleTimeChange } = useMonitoringTimeContainerContext(); const [zoomInLevel, setZoomInLevel] = useState(0); diff --git a/x-pack/plugins/monitoring/public/application/hooks/use_monitoring_time.ts b/x-pack/plugins/monitoring/public/application/hooks/use_monitoring_time.ts index 13f40fc89a704..74807fa957e6a 100644 --- a/x-pack/plugins/monitoring/public/application/hooks/use_monitoring_time.ts +++ b/x-pack/plugins/monitoring/public/application/hooks/use_monitoring_time.ts @@ -75,4 +75,5 @@ export const useMonitoringTime = () => { }; }; -export const MonitoringTimeContainer = createContainer(useMonitoringTime); +export const [MonitoringTimeContainer, useMonitoringTimeContainerContext] = + createContainer(useMonitoringTime); diff --git a/x-pack/plugins/monitoring/public/application/index.tsx b/x-pack/plugins/monitoring/public/application/index.tsx index 3fd12c312d13f..b313992863023 100644 --- a/x-pack/plugins/monitoring/public/application/index.tsx +++ b/x-pack/plugins/monitoring/public/application/index.tsx @@ -107,8 +107,8 @@ const MonitoringApp: React.FC<{ uiSettings={core.uiSettings} > - - + + @@ -336,8 +336,8 @@ const MonitoringApp: React.FC<{ /> - - + + diff --git a/x-pack/plugins/monitoring/public/application/pages/apm/instance.tsx b/x-pack/plugins/monitoring/public/application/pages/apm/instance.tsx index 97f19f3cf9204..e4340d6fdaa67 100644 --- a/x-pack/plugins/monitoring/public/application/pages/apm/instance.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/apm/instance.tsx @@ -13,7 +13,7 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; import { ComponentProps } from '../../route_init'; import { GlobalStateContext } from '../../contexts/global_state_context'; import { useCharts } from '../../hooks/use_charts'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { PageTemplate } from '../page_template'; // @ts-ignore import { ApmServerInstance } from '../../../components/apm/instance'; @@ -23,7 +23,7 @@ export const ApmInstancePage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { zoomInfo, onBrush } = useCharts(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; diff --git a/x-pack/plugins/monitoring/public/application/pages/apm/instances.tsx b/x-pack/plugins/monitoring/public/application/pages/apm/instances.tsx index 29f6a1f9e056e..e86ae43034af4 100644 --- a/x-pack/plugins/monitoring/public/application/pages/apm/instances.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/apm/instances.tsx @@ -17,7 +17,7 @@ import { ApmTemplate } from './apm_template'; import { ApmServerInstances } from '../../../components/apm/instances'; import { SetupModeRenderer } from '../../../components/renderers/setup_mode'; import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { APM_SYSTEM_ID } from '../../../../common/constants'; interface SetupModeProps { @@ -29,7 +29,7 @@ interface SetupModeProps { export const ApmInstancesPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { updateTotalItemCount, getPaginationTableProps } = useTable('apm.instances'); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; diff --git a/x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx index 1cf264daaeea3..39890954c877c 100644 --- a/x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx @@ -13,7 +13,7 @@ import { ComponentProps } from '../../route_init'; import { ApmTemplate } from './apm_template'; import { GlobalStateContext } from '../../contexts/global_state_context'; import { useCharts } from '../../hooks/use_charts'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; // @ts-ignore import { ApmOverview } from '../../../components/apm/overview'; @@ -23,7 +23,7 @@ export const ApmOverviewPage: React.FC = ({ clusters }) => { const { services } = useKibana<{ data: any }>(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const cluster = find(clusters, { cluster_uuid: clusterUuid, }) as any; diff --git a/x-pack/plugins/monitoring/public/application/pages/beats/instance.tsx b/x-pack/plugins/monitoring/public/application/pages/beats/instance.tsx index 68345db40caf2..f9b4794e44fed 100644 --- a/x-pack/plugins/monitoring/public/application/pages/beats/instance.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/beats/instance.tsx @@ -15,7 +15,7 @@ import { GlobalStateContext } from '../../contexts/global_state_context'; import { useCharts } from '../../hooks/use_charts'; // @ts-ignore import { Beat } from '../../../components/beats/beat'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { BeatsTemplate } from './beats_template'; export const BeatsInstancePage: React.FC = ({ clusters }) => { @@ -23,7 +23,7 @@ export const BeatsInstancePage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { zoomInfo, onBrush } = useCharts(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; diff --git a/x-pack/plugins/monitoring/public/application/pages/beats/instances.tsx b/x-pack/plugins/monitoring/public/application/pages/beats/instances.tsx index ea4f04151e83a..6fce1668fc98a 100644 --- a/x-pack/plugins/monitoring/public/application/pages/beats/instances.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/beats/instances.tsx @@ -17,13 +17,13 @@ import { BeatsTemplate } from './beats_template'; import { Listing } from '../../../components/beats/listing'; import { SetupModeRenderer, SetupModeProps } from '../../../components/renderers/setup_mode'; import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { BEATS_SYSTEM_ID } from '../../../../common/constants'; export const BeatsInstancesPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { updateTotalItemCount, getPaginationTableProps } = useTable('beats.instances'); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; diff --git a/x-pack/plugins/monitoring/public/application/pages/beats/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/beats/overview.tsx index 610fbe7ce2daf..4a142a8abd425 100644 --- a/x-pack/plugins/monitoring/public/application/pages/beats/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/beats/overview.tsx @@ -15,7 +15,7 @@ import { GlobalStateContext } from '../../contexts/global_state_context'; import { useCharts } from '../../hooks/use_charts'; // @ts-ignore import { BeatsOverview } from '../../../components/beats/overview'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const BeatsOverviewPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); @@ -23,7 +23,7 @@ export const BeatsOverviewPage: React.FC = ({ clusters }) => { const { services } = useKibana<{ data: any }>(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const cluster = find(clusters, { cluster_uuid: clusterUuid, }) as any; diff --git a/x-pack/plugins/monitoring/public/application/pages/cluster/overview_page.tsx b/x-pack/plugins/monitoring/public/application/pages/cluster/overview_page.tsx index d128beee7ce87..993cabad38af0 100644 --- a/x-pack/plugins/monitoring/public/application/pages/cluster/overview_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/cluster/overview_page.tsx @@ -16,7 +16,7 @@ import { Overview } from '../../../components/cluster/overview'; import { ExternalConfigContext } from '../../contexts/external_config_context'; import { SetupModeRenderer, SetupModeProps } from '../../../components/renderers/setup_mode'; import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { fetchClusters } from '../../../lib/fetch_clusters'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; @@ -33,7 +33,7 @@ export const ClusterOverview: React.FC<{}> = () => { const [clusters, setClusters] = useState([] as any); const [alerts, setAlerts] = useState({}); const [loaded, setLoaded] = useState(false); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); let tabs: TabMenuItem[] = []; diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_page.tsx index cc0113acb3b5f..9018d2ab2071d 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_page.tsx @@ -18,7 +18,7 @@ import { SetupModeContext } from '../../../components/setup_mode/setup_mode_cont import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { ELASTICSEARCH_SYSTEM_ID, RULE_CCR_READ_EXCEPTIONS } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; interface SetupModeProps { setupMode: any; flyoutComponent: any; @@ -27,7 +27,7 @@ interface SetupModeProps { export const ElasticsearchCcrPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { services } = useKibana<{ data: any }>(); const clusterUuid = globalState.cluster_uuid; diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_shard_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_shard_page.tsx index 925baa5edd052..3db3c25fd1f39 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_shard_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_shard_page.tsx @@ -20,7 +20,7 @@ import { SetupModeContext } from '../../../components/setup_mode/setup_mode_cont import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { ELASTICSEARCH_SYSTEM_ID, RULE_CCR_READ_EXCEPTIONS } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; interface SetupModeProps { setupMode: any; @@ -33,7 +33,7 @@ export const ElasticsearchCcrShardPage: React.FC = ({ clusters } const { services } = useKibana<{ data: any }>(); const [data, setData] = useState({} as any); const { index, shardId }: { index: string; shardId: string } = useParams(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const clusterUuid = globalState.cluster_uuid; const cluster = find(clusters, { diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_advanced_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_advanced_page.tsx index 410a909a9c4ab..0dab4a4d4bc52 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_advanced_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_advanced_page.tsx @@ -20,11 +20,11 @@ import { AdvancedIndex } from '../../../components/elasticsearch/index/advanced' import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { ELASTICSEARCH_SYSTEM_ID, RULE_LARGE_SHARD_SIZE } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const ElasticsearchIndexAdvancedPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { services } = useKibana<{ data: any }>(); const { index }: { index: string } = useParams(); const { zoomInfo, onBrush } = useCharts(); diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_page.tsx index dc2f718e64700..73c32fe0a42f3 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_page.tsx @@ -24,11 +24,11 @@ import { labels } from '../../../components/elasticsearch/shard_allocation/lib/l import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { ELASTICSEARCH_SYSTEM_ID, RULE_LARGE_SHARD_SIZE } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const ElasticsearchIndexPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { services } = useKibana<{ data: any }>(); const { index }: { index: string } = useParams(); const { zoomInfo, onBrush } = useCharts(); diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/indices_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/indices_page.tsx index d14015532167e..49be26854571e 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/indices_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/indices_page.tsx @@ -19,11 +19,11 @@ import { useLocalStorage } from '../../hooks/use_local_storage'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { ELASTICSEARCH_SYSTEM_ID, RULE_LARGE_SHARD_SIZE } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const ElasticsearchIndicesPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { services } = useKibana<{ data: any }>(); const { getPaginationTableProps } = useTable('elasticsearch.indices'); const clusterUuid = globalState.cluster_uuid; diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ml_jobs_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ml_jobs_page.tsx index 5c7fd227a0a53..0f9fe473ae4af 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ml_jobs_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ml_jobs_page.tsx @@ -16,7 +16,7 @@ import { SetupModeRenderer } from '../../../components/renderers/setup_mode'; import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context'; import { useTable } from '../../hooks/use_table'; import type { MLJobs } from '../../../types'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants'; interface SetupModeProps { @@ -27,7 +27,7 @@ interface SetupModeProps { export const ElasticsearchMLJobsPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { services } = useKibana<{ data: any }>(); const { getPaginationTableProps } = useTable('elasticsearch.mlJobs'); const clusterUuid = globalState.cluster_uuid; diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_advanced_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_advanced_page.tsx index 05394a6d36aec..bf4b6c48b551e 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_advanced_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_advanced_page.tsx @@ -25,11 +25,11 @@ import { RULE_DISK_USAGE, RULE_MEMORY_USAGE, } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const ElasticsearchNodeAdvancedPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { zoomInfo, onBrush } = useCharts(); const [data, setData] = useState({} as any); diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_page.tsx index e41e921985015..b6682a2da876d 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_page.tsx @@ -31,11 +31,11 @@ import { RULE_DISK_USAGE, RULE_MEMORY_USAGE, } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const ElasticsearchNodePage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { zoomInfo, onBrush } = useCharts(); const [showSystemIndices, setShowSystemIndices] = useLocalStorage( 'showSystemIndices', diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/nodes_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/nodes_page.tsx index 156d8463b80be..b258361474a61 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/nodes_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/nodes_page.tsx @@ -16,7 +16,7 @@ import { ComponentProps } from '../../route_init'; import { SetupModeRenderer, SetupModeProps } from '../../../components/renderers/setup_mode'; import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context'; import { useTable } from '../../hooks/use_table'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { @@ -34,7 +34,7 @@ export const ElasticsearchNodesPage: React.FC = ({ clusters }) = const { showCgroupMetricsElasticsearch } = useContext(ExternalConfigContext); const { services } = useKibana<{ data: any }>(); const [isLoading, setIsLoading] = React.useState(false); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { getPaginationRouteOptions, updateTotalItemCount, getPaginationTableProps } = useTable('elasticsearch.nodes'); const clusterUuid = globalState.cluster_uuid; diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/overview.tsx index c4524bb161040..4e213405cfd08 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/overview.tsx @@ -14,13 +14,13 @@ import { GlobalStateContext } from '../../contexts/global_state_context'; import { ElasticsearchOverview } from '../../../components/elasticsearch'; import { ComponentProps } from '../../route_init'; import { useCharts } from '../../hooks/use_charts'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const ElasticsearchOverviewPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { zoomInfo, onBrush } = useCharts(); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; const cluster = find(clusters, { diff --git a/x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx index 75d2d2f89fae1..0cd97166dcf5d 100644 --- a/x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx @@ -14,7 +14,7 @@ import { EntSearchTemplate } from './ent_search_template'; import { GlobalStateContext } from '../../contexts/global_state_context'; import { useCharts } from '../../hooks/use_charts'; import { EnterpriseSearchOverview } from '../../../components/enterprise_search/overview'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const EntSearchOverviewPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); @@ -22,7 +22,7 @@ export const EntSearchOverviewPage: React.FC = ({ clusters }) => const { services } = useKibana<{ data: any }>(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const cluster = find(clusters, { cluster_uuid: clusterUuid, }) as any; diff --git a/x-pack/plugins/monitoring/public/application/pages/home/cluster_listing.tsx b/x-pack/plugins/monitoring/public/application/pages/home/cluster_listing.tsx index 80c46342294f5..45ed6172d4262 100644 --- a/x-pack/plugins/monitoring/public/application/pages/home/cluster_listing.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/home/cluster_listing.tsx @@ -17,7 +17,7 @@ import { ExternalConfigContext } from '../../contexts/external_config_context'; import { ComponentProps } from '../../route_init'; import { useTable } from '../../hooks/use_table'; import { PageTemplate, TabMenuItem } from '../page_template'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { fetchClusters } from '../../../lib/fetch_clusters'; const pageTitle = i18n.translate('xpack.monitoring.cluster.listing.pageTitle', { @@ -40,7 +40,7 @@ export const ClusterListing: React.FC = () => { const externalConfig = useContext(ExternalConfigContext); const { services } = useKibana<{ data: any }>(); const [clusters, setClusters] = useState([] as any); - const { update: updateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { update: updateBreadcrumbs } = useBreadcrumbContainerContext(); const fakeScope = { $evalAsync: (fn: () => void) => fn(), diff --git a/x-pack/plugins/monitoring/public/application/pages/kibana/instance.tsx b/x-pack/plugins/monitoring/public/application/pages/kibana/instance.tsx index c1dfecd69d2a8..56d8b6742c282 100644 --- a/x-pack/plugins/monitoring/public/application/pages/kibana/instance.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/kibana/instance.tsx @@ -23,7 +23,7 @@ import { ComponentProps } from '../../route_init'; import { GlobalStateContext } from '../../contexts/global_state_context'; import { useCharts } from '../../hooks/use_charts'; // @ts-ignore -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; // @ts-ignore import { MonitoringTimeseriesContainer } from '../../../components/chart'; // @ts-ignore @@ -148,7 +148,7 @@ export const KibanaInstancePage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; const cluster = find(clusters, { diff --git a/x-pack/plugins/monitoring/public/application/pages/kibana/instances.tsx b/x-pack/plugins/monitoring/public/application/pages/kibana/instances.tsx index 6f1f822b8488f..5d272be8be30c 100644 --- a/x-pack/plugins/monitoring/public/application/pages/kibana/instances.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/kibana/instances.tsx @@ -18,7 +18,7 @@ import { KibanaInstances } from '../../../components/kibana/instances'; // @ts-ignore import { SetupModeRenderer, SetupModeProps } from '../../../components/renderers/setup_mode'; import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { KIBANA_SYSTEM_ID, RULE_KIBANA_VERSION_MISMATCH } from '../../../../common/constants'; @@ -26,7 +26,7 @@ import { KIBANA_SYSTEM_ID, RULE_KIBANA_VERSION_MISMATCH } from '../../../../comm export const KibanaInstancesPage: React.FC = ({ clusters }) => { const { cluster_uuid: clusterUuid, ccs } = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { updateTotalItemCount, getPaginationTableProps } = useTable('kibana.instances'); const cluster = find(clusters, { cluster_uuid: clusterUuid, diff --git a/x-pack/plugins/monitoring/public/application/pages/kibana/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/kibana/overview.tsx index 5ae89fd929eb4..dd31acec85e11 100644 --- a/x-pack/plugins/monitoring/public/application/pages/kibana/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/kibana/overview.tsx @@ -25,7 +25,7 @@ import { ComponentProps } from '../../route_init'; import { MonitoringTimeseriesContainer } from '../../../components/chart'; // @ts-ignore import { ClusterStatus } from '../../../components/kibana/cluster_status'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { useCharts } from '../../hooks/use_charts'; const KibanaOverview = ({ data }: { data: any }) => { @@ -107,7 +107,7 @@ const KibanaOverview = ({ data }: { data: any }) => { export const KibanaOverviewPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const [data, setData] = useState(); const clusterUuid = globalState.cluster_uuid; const cluster = find(clusters, { diff --git a/x-pack/plugins/monitoring/public/application/pages/license_page.tsx b/x-pack/plugins/monitoring/public/application/pages/license_page.tsx index 2f0e424d14238..b7288ce1b872b 100644 --- a/x-pack/plugins/monitoring/public/application/pages/license_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/license_page.tsx @@ -13,7 +13,7 @@ import { PageTemplate } from './page_template'; import { License } from '../../components'; import { GlobalStateContext } from '../contexts/global_state_context'; import { CODE_PATH_LICENSE, STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../common/constants'; -import { MonitoringTimeContainer } from '../hooks/use_monitoring_time'; +import { useMonitoringTimeContainerContext } from '../hooks/use_monitoring_time'; const CODE_PATHS = [CODE_PATH_LICENSE]; @@ -22,7 +22,7 @@ export const LicensePage: React.FC<{}> = () => { defaultMessage: 'License', }); - const { setIsDisabled } = useContext(MonitoringTimeContainer.Context); + const { setIsDisabled } = useMonitoringTimeContainerContext(); useEffect(() => { setIsDisabled(true); return () => { diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/advanced.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/advanced.tsx index 29b2e4f6c1e44..f89d7b5df3726 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/advanced.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/advanced.tsx @@ -30,7 +30,7 @@ import { useCharts } from '../../hooks/use_charts'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { RULE_LOGSTASH_VERSION_MISMATCH } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const LogStashNodeAdvancedPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); @@ -43,7 +43,7 @@ export const LogStashNodeAdvancedPage: React.FC = ({ clusters }) cluster_uuid: clusterUuid, }) as any; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const [data, setData] = useState({} as any); const [alerts, setAlerts] = useState({}); diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/node.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/node.tsx index 772bf5718c4ec..75d752b696fd9 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/node.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/node.tsx @@ -31,13 +31,13 @@ import { useCharts } from '../../hooks/use_charts'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { RULE_LOGSTASH_VERSION_MISMATCH } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const LogStashNodePage: React.FC = ({ clusters }) => { const match = useRouteMatch<{ uuid: string | undefined }>(); const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; const cluster = find(clusters, { diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/node_pipelines.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/node_pipelines.tsx index 90c8421a31eb0..6c97661e915cb 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/node_pipelines.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/node_pipelines.tsx @@ -20,7 +20,7 @@ import { useTable } from '../../hooks/use_table'; // @ts-expect-error import { PipelineListing } from '../../../components/logstash/pipeline_listing/pipeline_listing'; import { useCharts } from '../../hooks/use_charts'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const LogStashNodePipelinesPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); @@ -33,7 +33,7 @@ export const LogStashNodePipelinesPage: React.FC = ({ clusters } cluster_uuid: clusterUuid, }) as any; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { getPaginationTableProps, getPaginationRouteOptions, updateTotalItemCount } = useTable('logstash.pipelines'); diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/nodes.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/nodes.tsx index b350f057aae96..d3097ecc4a145 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/nodes.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/nodes.tsx @@ -19,7 +19,7 @@ import { useTable } from '../../hooks/use_table'; import { LOGSTASH_SYSTEM_ID, RULE_LOGSTASH_VERSION_MISMATCH } from '../../../../common/constants'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; interface SetupModeProps { setupMode: any; @@ -32,7 +32,7 @@ export const LogStashNodesPage: React.FC = ({ clusters }) => { const { services } = useKibana<{ data: any }>(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const cluster = find(clusters, { cluster_uuid: clusterUuid, }) as any; diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/overview.tsx index e8b9dda758713..20e7339e2b580 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/overview.tsx @@ -14,7 +14,7 @@ import { useCharts } from '../../hooks/use_charts'; // @ts-ignore import { Overview } from '../../../components/logstash/overview'; import { LogstashTemplate } from './logstash_template'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const LogStashOverviewPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); @@ -25,7 +25,7 @@ export const LogStashOverviewPage: React.FC = ({ clusters }) => const cluster = find(clusters, { cluster_uuid: clusterUuid, }) as any; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const [data, setData] = useState(null); // const [showShardActivityHistory, setShowShardActivityHistory] = useState(false); diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/pipeline.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/pipeline.tsx index af68390aa4e76..c3c229458da08 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/pipeline.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/pipeline.tsx @@ -29,7 +29,7 @@ import { formatTimestampToDuration } from '../../../../common'; import { CALCULATE_DURATION_SINCE } from '../../../../common/constants'; import { getSafeForExternalLink } from '../../../lib/get_safe_for_external_link'; import { PipelineVersions } from './pipeline_versions_dropdown'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const LogStashPipelinePage: React.FC = ({ clusters }) => { const match = useRouteMatch<{ id: string | undefined; hash: string | undefined }>(); @@ -126,7 +126,7 @@ export const LogStashPipelinePage: React.FC = ({ clusters }) => }, [data]); const timeseriesTooltipXValueFormatter = (xValue: any) => moment(xValue).format(dateFormat); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const onVertexChange = useCallback((vertex: any) => { if (!vertex) { diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/pipelines.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/pipelines.tsx index a669b06ac8bcf..19d5277f1a85a 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/pipelines.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/pipelines.tsx @@ -17,7 +17,7 @@ import { isPipelineMonitoringSupportedInVersion } from '../../../lib/logstash/pi import { PipelineListing } from '../../../components/logstash/pipeline_listing/pipeline_listing'; import { LogstashTemplate } from './logstash_template'; import { useTable } from '../../hooks/use_table'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const LogStashPipelinesPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); @@ -43,7 +43,7 @@ export const LogStashPipelinesPage: React.FC = ({ clusters }) => defaultMessage: 'Logstash pipelines', }); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const getPageData = useCallback(async () => { const bounds = services.data?.query.timefilter.timefilter.getBounds(); diff --git a/x-pack/plugins/monitoring/public/application/pages/no_data/no_data_page.tsx b/x-pack/plugins/monitoring/public/application/pages/no_data/no_data_page.tsx index d0806c1d86c02..ef6707a61d359 100644 --- a/x-pack/plugins/monitoring/public/application/pages/no_data/no_data_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/no_data/no_data_page.tsx @@ -16,7 +16,7 @@ import { PageTemplate } from '../page_template'; import { CODE_PATH_LICENSE, STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../../common/constants'; import { Legacy } from '../../../legacy_shims'; import { Enabler } from './enabler'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { initSetupModeState } from '../../../lib/setup_mode'; import { GlobalStateContext } from '../../contexts/global_state_context'; import { useRequestErrorHandler } from '../../hooks/use_request_error_handler'; @@ -67,7 +67,7 @@ export const NoDataPage = () => { isCollectionIntervalUpdated: false, } as any); - const { update: updateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { update: updateBreadcrumbs } = useBreadcrumbContainerContext(); updateBreadcrumbs([ { 'data-test-subj': 'breadcrumbClusters', diff --git a/x-pack/plugins/monitoring/public/application/pages/page_template.tsx b/x-pack/plugins/monitoring/public/application/pages/page_template.tsx index 8e07d196ce588..842c86cc4ab95 100644 --- a/x-pack/plugins/monitoring/public/application/pages/page_template.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/page_template.tsx @@ -20,7 +20,7 @@ import type { IHttpFetchError, ResponseErrorBody } from '@kbn/core-http-browser' import { HeaderMenuPortal } from '@kbn/observability-plugin/public'; import { useTitle } from '../hooks/use_title'; import { MonitoringToolbar } from '../../components/shared/toolbar'; -import { MonitoringTimeContainer } from '../hooks/use_monitoring_time'; +import { useMonitoringTimeContainerContext } from '../hooks/use_monitoring_time'; import { PageLoading } from '../../components'; import { getSetupModeState, @@ -58,7 +58,7 @@ export const PageTemplate: React.FC = ({ }) => { useTitle('', title); - const { currentTimerange } = useContext(MonitoringTimeContainer.Context); + const { currentTimerange } = useMonitoringTimeContainerContext(); const [loaded, setLoaded] = useState(false); const [isRequestPending, setIsRequestPending] = useState(false); const history = useHistory(); diff --git a/x-pack/plugins/monitoring/public/components/shared/toolbar.tsx b/x-pack/plugins/monitoring/public/components/shared/toolbar.tsx index 200ce9f849433..ae90a304a019f 100644 --- a/x-pack/plugins/monitoring/public/components/shared/toolbar.tsx +++ b/x-pack/plugins/monitoring/public/components/shared/toolbar.tsx @@ -9,7 +9,7 @@ import { EuiPageHeader, EuiSuperDatePicker, OnRefreshChangeProps } from '@elasti import React, { useContext, useCallback, useMemo } from 'react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { UI_SETTINGS } from '@kbn/data-plugin/common'; -import { MonitoringTimeContainer } from '../../application/hooks/use_monitoring_time'; +import { useMonitoringTimeContainerContext } from '../../application/hooks/use_monitoring_time'; import { GlobalStateContext } from '../../application/contexts/global_state_context'; import { Legacy } from '../../legacy_shims'; import { MonitoringStartServices } from '../../types'; @@ -49,7 +49,7 @@ export const MonitoringToolbar: React.FC = ({ pageTitle, setIsPaused, isPaused, isDisabled, - } = useContext(MonitoringTimeContainer.Context); + } = useMonitoringTimeContainerContext(); const state = useContext(GlobalStateContext); const onTimeChange = useCallback( diff --git a/x-pack/plugins/monitoring/public/components/table/storage.ts b/x-pack/plugins/monitoring/public/components/table/storage.ts index 7d4d3129650ae..3c28be3fe6114 100644 --- a/x-pack/plugins/monitoring/public/components/table/storage.ts +++ b/x-pack/plugins/monitoring/public/components/table/storage.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get } from 'lodash'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import { STORAGE_KEY } from '../../../common/constants'; diff --git a/x-pack/plugins/monitoring/public/lib/calculate_shard_stats.js b/x-pack/plugins/monitoring/public/lib/calculate_shard_stats.js index f74fd30fde84b..cb01c182694b4 100644 --- a/x-pack/plugins/monitoring/public/lib/calculate_shard_stats.js +++ b/x-pack/plugins/monitoring/public/lib/calculate_shard_stats.js @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get, each } from 'lodash'; function addOne(obj, key) { diff --git a/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.ts b/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.ts index d8bf8487cee09..dd69669405098 100644 --- a/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.ts +++ b/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.ts @@ -7,7 +7,7 @@ import { notFound } from '@hapi/boom'; import { get, omit } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { i18n } from '@kbn/i18n'; import { getClustersStats } from './get_clusters_stats'; import { flagSupportedClusters } from './flag_supported_clusters'; diff --git a/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_state.test.js b/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_state.test.js index 6b35012c9d55b..1b9e40e4d6300 100644 --- a/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_state.test.js +++ b/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_state.test.js @@ -7,7 +7,7 @@ import { handleResponse } from './get_clusters_state'; import moment from 'moment'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; const clusters = [ { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.test.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.test.js index a04e53fdbbe9d..9ddcecb0cbbd0 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.test.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { handleResponse } from './get_ml_jobs'; describe('Get ML Jobs', () => { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/calculate_node_type.test.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/calculate_node_type.test.js index d249bc82b9387..915c305d294c7 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/calculate_node_type.test.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/calculate_node_type.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { calculateNodeType } from './calculate_node_type'; const masterNodeId = 'def456'; diff --git a/x-pack/plugins/monitoring/server/telemetry_collection/create_query.test.ts b/x-pack/plugins/monitoring/server/telemetry_collection/create_query.test.ts index 236b9280c3b05..c24efe86e48ff 100644 --- a/x-pack/plugins/monitoring/server/telemetry_collection/create_query.test.ts +++ b/x-pack/plugins/monitoring/server/telemetry_collection/create_query.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { createTypeFilter, createQuery } from './create_query'; describe('Create Type Filter', () => { diff --git a/x-pack/plugins/monitoring/server/telemetry_collection/get_all_stats.ts b/x-pack/plugins/monitoring/server/telemetry_collection/get_all_stats.ts index f1c36f848ca98..f74c712fb055a 100644 --- a/x-pack/plugins/monitoring/server/telemetry_collection/get_all_stats.ts +++ b/x-pack/plugins/monitoring/server/telemetry_collection/get_all_stats.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get, merge } from 'lodash'; import moment from 'moment'; diff --git a/x-pack/plugins/observability/common/index.ts b/x-pack/plugins/observability/common/index.ts index 794275c380c97..379404c3a48a1 100644 --- a/x-pack/plugins/observability/common/index.ts +++ b/x-pack/plugins/observability/common/index.ts @@ -15,7 +15,6 @@ export { enableInspectEsQueries, maxSuggestions, enableComparisonByDefault, - enableInfrastructureView, defaultApmServiceEnvironment, apmServiceInventoryOptimizedSorting, apmProgressiveLoading, diff --git a/x-pack/plugins/observability/common/ui_settings_keys.ts b/x-pack/plugins/observability/common/ui_settings_keys.ts index 60328a189b696..f3c77c76d4186 100644 --- a/x-pack/plugins/observability/common/ui_settings_keys.ts +++ b/x-pack/plugins/observability/common/ui_settings_keys.ts @@ -9,7 +9,6 @@ export const enableNewSyntheticsView = 'observability:enableNewSyntheticsView'; export const enableInspectEsQueries = 'observability:enableInspectEsQueries'; export const maxSuggestions = 'observability:maxSuggestions'; export const enableComparisonByDefault = 'observability:enableComparisonByDefault'; -export const enableInfrastructureView = 'observability:enableInfrastructureView'; export const defaultApmServiceEnvironment = 'observability:apmDefaultServiceEnvironment'; export const apmProgressiveLoading = 'observability:apmProgressiveLoading'; export const enableServiceGroups = 'observability:enableServiceGroups'; diff --git a/x-pack/plugins/observability/kibana.json b/x-pack/plugins/observability/kibana.json index 5464bffccd9cd..7754aedfe9ffc 100644 --- a/x-pack/plugins/observability/kibana.json +++ b/x-pack/plugins/observability/kibana.json @@ -31,7 +31,6 @@ "triggersActionsUi", "inspector", "unifiedSearch", - "sharedUX", "security" ], "ui": true, diff --git a/x-pack/plugins/observability/public/application/application.test.tsx b/x-pack/plugins/observability/public/application/application.test.tsx index 371be0ceb3a34..d630988446aa6 100644 --- a/x-pack/plugins/observability/public/application/application.test.tsx +++ b/x-pack/plugins/observability/public/application/application.test.tsx @@ -11,7 +11,7 @@ import React from 'react'; import { Observable } from 'rxjs'; import { AppMountParameters, CoreStart } from '@kbn/core/public'; import { themeServiceMock } from '@kbn/core/public/mocks'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { ObservabilityPublicPluginsStart } from '../plugin'; import { createObservabilityRuleTypeRegistryMock } from '../rules/observability_rule_type_registry_mock'; import { renderApp } from '.'; diff --git a/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx b/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx index 6ba0556fa0172..00b4e464e1f45 100644 --- a/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx +++ b/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx @@ -17,7 +17,7 @@ import * as pluginContext from '../../../../hooks/use_plugin_context'; import { HasDataContextValue } from '../../../../context/has_data_context'; import { AppMountParameters } from '@kbn/core/public'; import { createObservabilityRuleTypeRegistryMock } from '../../../../rules/observability_rule_type_registry_mock'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; jest.mock('react-router-dom', () => ({ useLocation: () => ({ diff --git a/x-pack/plugins/observability/public/components/shared/header_menu_portal.tsx b/x-pack/plugins/observability/public/components/shared/header_menu_portal.tsx index 02d16c13ce4e8..dcfe8b9ce85ba 100644 --- a/x-pack/plugins/observability/public/components/shared/header_menu_portal.tsx +++ b/x-pack/plugins/observability/public/components/shared/header_menu_portal.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useMemo } from 'react'; -import { createPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; +import { createHtmlPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import { HeaderMenuPortalProps } from './types'; @@ -16,7 +16,7 @@ export default function HeaderMenuPortal({ setHeaderActionMenu, theme$, }: HeaderMenuPortalProps) { - const portalNode = useMemo(() => createPortalNode(), []); + const portalNode = useMemo(() => createHtmlPortalNode(), []); useEffect(() => { setHeaderActionMenu((element) => { diff --git a/x-pack/plugins/observability/public/components/shared/page_template/page_template.test.tsx b/x-pack/plugins/observability/public/components/shared/page_template/page_template.test.tsx index 176e137242ebc..89574732b5a85 100644 --- a/x-pack/plugins/observability/public/components/shared/page_template/page_template.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/page_template/page_template.test.tsx @@ -10,7 +10,8 @@ import { render } from '@testing-library/react'; import { shallow } from 'enzyme'; import React from 'react'; import { of } from 'rxjs'; -import { sharedUXPluginMock } from '@kbn/shared-ux-plugin/public/mocks'; +import { getKibanaPageTemplateKibanaDependenciesMock as getPageTemplateServices } from '@kbn/shared-ux-page-kibana-template-mocks'; + import { createNavigationRegistry } from '../../../services/navigation_registry'; import { createLazyObservabilityPageTemplate } from './lazy_page_template'; import { ObservabilityPageTemplate } from './page_template'; @@ -52,7 +53,7 @@ describe('Page template', () => { getUrlForApp: () => '/test-url', navigateToApp: async () => {}, navigationSections$: navigationRegistry.sections$, - getSharedUXContext: sharedUXPluginMock.createStartContract().getContextServices, + getPageTemplateServices, }); const component = shallow( @@ -76,11 +77,11 @@ describe('Page template', () => { getUrlForApp={() => '/test-url'} navigateToApp={async () => {}} navigationSections$={navigationRegistry.sections$} - getSharedUXContext={sharedUXPluginMock.createStartContract().getContextServices} pageHeader={{ pageTitle: 'Test title', rightSideItems: [Test side item], }} + getPageTemplateServices={getPageTemplateServices} >

Test structure
@@ -97,11 +98,11 @@ describe('Page template', () => { getUrlForApp={() => '/test-url'} navigateToApp={async () => {}} navigationSections$={navigationRegistry.sections$} - getSharedUXContext={sharedUXPluginMock.createStartContract().getContextServices} pageHeader={{ pageTitle: 'Test title', rightSideItems: [Test side item], }} + getPageTemplateServices={getPageTemplateServices} >
Test structure
diff --git a/x-pack/plugins/observability/public/components/shared/page_template/page_template.tsx b/x-pack/plugins/observability/public/components/shared/page_template/page_template.tsx index ee05d2c4b59cb..d852a8658c2e1 100644 --- a/x-pack/plugins/observability/public/components/shared/page_template/page_template.tsx +++ b/x-pack/plugins/observability/public/components/shared/page_template/page_template.tsx @@ -12,10 +12,15 @@ import { matchPath, useLocation } from 'react-router-dom'; import useObservable from 'react-use/lib/useObservable'; import type { Observable } from 'rxjs'; import type { ApplicationStart } from '@kbn/core/public'; -import { SharedUxServicesProvider } from '@kbn/shared-ux-services'; -import type { SharedUXPluginStart } from '@kbn/shared-ux-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplate, KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import { + KibanaPageTemplate, + KibanaPageTemplateKibanaProvider, +} from '@kbn/shared-ux-page-kibana-template'; +import type { + KibanaPageTemplateProps, + KibanaPageTemplateKibanaDependencies, +} from '@kbn/shared-ux-page-kibana-template'; import type { NavigationSection } from '../../../services/navigation_registry'; import { ObservabilityTour } from '../tour'; import { NavNameWithBadge, hideBadge } from './nav_name_with_badge'; @@ -43,7 +48,7 @@ export interface ObservabilityPageTemplateDependencies { getUrlForApp: ApplicationStart['getUrlForApp']; navigateToApp: ApplicationStart['navigateToApp']; navigationSections$: Observable; - getSharedUXContext: SharedUXPluginStart['getContextServices']; + getPageTemplateServices: () => KibanaPageTemplateKibanaDependencies; } export type ObservabilityPageTemplateProps = ObservabilityPageTemplateDependencies & @@ -55,15 +60,14 @@ export function ObservabilityPageTemplate({ getUrlForApp, navigateToApp, navigationSections$, - getSharedUXContext, showSolutionNav = true, isPageDataLoaded = true, + getPageTemplateServices, ...pageTemplateProps }: ObservabilityPageTemplateProps): React.ReactElement | null { const sections = useObservable(navigationSections$, []); const currentAppId = useObservable(currentAppId$, undefined); const { pathname: currentPath } = useLocation(); - const sharedUXServices = getSharedUXContext(); const { services } = useKibana(); @@ -130,7 +134,7 @@ export function ObservabilityPageTemplate({ ); return ( - + - + ); } diff --git a/x-pack/plugins/observability/public/index.ts b/x-pack/plugins/observability/public/index.ts index 04cb8289dd247..b4e23ce0e83ad 100644 --- a/x-pack/plugins/observability/public/index.ts +++ b/x-pack/plugins/observability/public/index.ts @@ -27,7 +27,6 @@ export type { export { enableInspectEsQueries, enableComparisonByDefault, - enableInfrastructureView, enableServiceGroups, enableNewSyntheticsView, apmServiceGroupMaxNumberOfServices, diff --git a/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx b/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx index b384047a1c77b..bab4397a49a75 100644 --- a/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx +++ b/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx @@ -9,7 +9,7 @@ import React, { ComponentType } from 'react'; import { MemoryRouter } from 'react-router-dom'; import { AppMountParameters } from '@kbn/core/public'; import { CoreStart } from '@kbn/core/public'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import { casesFeatureId } from '../../../common'; import { PluginContext, PluginContextValue } from '../../context/plugin_context'; diff --git a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx index aab1663482636..2e384e83fd03d 100644 --- a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx +++ b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx @@ -12,7 +12,7 @@ import React, { ReactNode } from 'react'; import { MemoryRouter } from 'react-router-dom'; import { UI_SETTINGS } from '@kbn/data-plugin/public'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { HasDataContextProvider } from '../../context/has_data_context'; import { PluginContext } from '../../context/plugin_context'; import { registerDataHandler, unregisterDataHandler } from '../../data_handler'; diff --git a/x-pack/plugins/observability/public/pages/rules/index.test.tsx b/x-pack/plugins/observability/public/pages/rules/index.test.tsx index a9bf4aff99a83..cc8a093e32333 100644 --- a/x-pack/plugins/observability/public/pages/rules/index.test.tsx +++ b/x-pack/plugins/observability/public/pages/rules/index.test.tsx @@ -14,7 +14,7 @@ import { ObservabilityPublicPluginsStart } from '../../plugin'; import { RulesPage } from '.'; import { kibanaStartMock } from '../../utils/kibana_react.mock'; import * as pluginContext from '../../hooks/use_plugin_context'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { createObservabilityRuleTypeRegistryMock } from '../../rules/observability_rule_type_registry_mock'; import { AppMountParameters } from '@kbn/core/public'; import { ALERTS_FEATURE_ID } from '@kbn/alerting-plugin/common'; diff --git a/x-pack/plugins/observability/public/plugin.ts b/x-pack/plugins/observability/public/plugin.ts index 617dce2959f1e..97b3746671c9d 100644 --- a/x-pack/plugins/observability/public/plugin.ts +++ b/x-pack/plugins/observability/public/plugin.ts @@ -26,7 +26,6 @@ import type { EmbeddableStart } from '@kbn/embeddable-plugin/public'; import type { HomePublicPluginSetup, HomePublicPluginStart } from '@kbn/home-plugin/public'; import { CasesDeepLinkId, CasesUiStart, getCasesDeepLinks } from '@kbn/cases-plugin/public'; import type { LensPublicStart } from '@kbn/lens-plugin/public'; -import type { SharedUXPluginStart } from '@kbn/shared-ux-plugin/public'; import { TriggersAndActionsUIPublicPluginSetup, TriggersAndActionsUIPublicPluginStart, @@ -72,7 +71,6 @@ export interface ObservabilityPublicPluginsStart { dataViews: DataViewsPublicPluginStart; lens: LensPublicStart; discover: DiscoverStart; - sharedUX: SharedUXPluginStart; ruleTypeRegistry: RuleTypeRegistryContract; actionTypeRegistry: ActionTypeRegistryContract; security: SecurityPluginStart; @@ -282,7 +280,7 @@ export class Plugin getUrlForApp: application.getUrlForApp, navigateToApp: application.navigateToApp, navigationSections$: this.navigationRegistry.sections$, - getSharedUXContext: pluginsStart.sharedUX.getContextServices, + getPageTemplateServices: () => ({ coreStart }), }); const getAsyncO11yAlertsTableConfiguration = async () => { diff --git a/x-pack/plugins/observability/public/utils/no_data_config.ts b/x-pack/plugins/observability/public/utils/no_data_config.ts index c71520e35bf18..be19e6658b5b6 100644 --- a/x-pack/plugins/observability/public/utils/no_data_config.ts +++ b/x-pack/plugins/observability/public/utils/no_data_config.ts @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import { IBasePath } from '@kbn/core/public'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { NoDataConfig } from '@kbn/shared-ux-page-kibana-template'; export function getNoDataConfig({ docsLink, @@ -17,7 +17,7 @@ export function getNoDataConfig({ docsLink: string; basePath: IBasePath; hasData?: boolean; -}): KibanaPageTemplateProps['noDataConfig'] { +}): NoDataConfig | undefined { if (hasData === false) { return { solution: i18n.translate('xpack.observability.noDataConfig.solutionName', { diff --git a/x-pack/plugins/observability/public/utils/test_helper.tsx b/x-pack/plugins/observability/public/utils/test_helper.tsx index d262f290d1fe1..ef197f7dfc8d5 100644 --- a/x-pack/plugins/observability/public/utils/test_helper.tsx +++ b/x-pack/plugins/observability/public/utils/test_helper.tsx @@ -12,7 +12,7 @@ import { coreMock } from '@kbn/core/public/mocks'; import React from 'react'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import translations from '@kbn/translations-plugin/translations/ja-JP.json'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; diff --git a/x-pack/plugins/observability/server/ui_settings.ts b/x-pack/plugins/observability/server/ui_settings.ts index 36fb6cd9f62ff..f22da4b96e6b9 100644 --- a/x-pack/plugins/observability/server/ui_settings.ts +++ b/x-pack/plugins/observability/server/ui_settings.ts @@ -13,7 +13,6 @@ import { enableComparisonByDefault, enableInspectEsQueries, maxSuggestions, - enableInfrastructureView, defaultApmServiceEnvironment, apmProgressiveLoading, enableServiceGroups, @@ -84,17 +83,6 @@ export const uiSettings: Record { }); it('by changing ecs mappings and platforms', () => { + cy.getBySel('pagination-button-next').click(); cy.react('CustomItemAction', { props: { index: 1, item: { attributes: { id: SAVED_QUERY_ID } } }, }).click(); diff --git a/x-pack/plugins/osquery/cypress/integration/all/metrics.spec.ts b/x-pack/plugins/osquery/cypress/integration/all/metrics.spec.ts index 88145dfa46401..0edefdc24ea42 100644 --- a/x-pack/plugins/osquery/cypress/integration/all/metrics.spec.ts +++ b/x-pack/plugins/osquery/cypress/integration/all/metrics.spec.ts @@ -46,7 +46,7 @@ describe('ALL - Inventory', () => { cy.getBySel('comboBoxInput').first().click(); cy.wait(500); - cy.getBySel('comboBoxInput').first().type('{downArrow}{enter}'); + cy.getBySel('comboBoxInput').first().type('saved{downArrow}{enter}'); submitQuery(); checkResults(); diff --git a/x-pack/plugins/osquery/cypress/integration/roles/reader.spec.ts b/x-pack/plugins/osquery/cypress/integration/roles/reader.spec.ts index ddbca76efcf16..365f4d5b0eba1 100644 --- a/x-pack/plugins/osquery/cypress/integration/roles/reader.spec.ts +++ b/x-pack/plugins/osquery/cypress/integration/roles/reader.spec.ts @@ -27,6 +27,7 @@ describe('Reader - only READ', () => { it('should not be able to add nor run saved queries', () => { navigateTo('/app/osquery/saved_queries'); cy.waitForReact(1000); + cy.getBySel('pagination-button-next').click(); cy.contains(SAVED_QUERY_ID); cy.contains('Add saved query').should('be.disabled'); cy.react('PlayButtonComponent', { diff --git a/x-pack/plugins/osquery/cypress/integration/roles/t1_analyst.spec.ts b/x-pack/plugins/osquery/cypress/integration/roles/t1_analyst.spec.ts index c151cce2c2e60..2920cf8521ac6 100644 --- a/x-pack/plugins/osquery/cypress/integration/roles/t1_analyst.spec.ts +++ b/x-pack/plugins/osquery/cypress/integration/roles/t1_analyst.spec.ts @@ -29,6 +29,7 @@ describe('T1 Analyst - READ + runSavedQueries ', () => { it('should be able to run saved queries but not add new ones', () => { navigateTo('/app/osquery/saved_queries'); cy.waitForReact(1000); + cy.getBySel('pagination-button-next').click(); cy.contains(SAVED_QUERY_ID); cy.contains('Add saved query').should('be.disabled'); cy.react('PlayButtonComponent', { diff --git a/x-pack/plugins/osquery/cypress/integration/roles/t2_analyst.spec.ts b/x-pack/plugins/osquery/cypress/integration/roles/t2_analyst.spec.ts index 901b18f1461c7..9b73a01ac41c1 100644 --- a/x-pack/plugins/osquery/cypress/integration/roles/t2_analyst.spec.ts +++ b/x-pack/plugins/osquery/cypress/integration/roles/t2_analyst.spec.ts @@ -100,7 +100,7 @@ describe('T2 Analyst - READ + Write Live/Saved + runSavedQueries ', () => { }); it('to click the edit button and edit pack', () => { navigateTo('/app/osquery/saved_queries'); - + cy.getBySel('pagination-button-next').click(); cy.react('CustomItemAction', { props: { index: 1, item: { attributes: { id: SAVED_QUERY_ID } } }, }).click(); diff --git a/x-pack/plugins/osquery/cypress/tasks/live_query.ts b/x-pack/plugins/osquery/cypress/tasks/live_query.ts index 3a1f1b0930edf..140b5698f55b5 100644 --- a/x-pack/plugins/osquery/cypress/tasks/live_query.ts +++ b/x-pack/plugins/osquery/cypress/tasks/live_query.ts @@ -8,7 +8,7 @@ import { LIVE_QUERY_EDITOR } from '../screens/live_query'; export const DEFAULT_QUERY = 'select * from processes;'; -export const BIG_QUERY = 'select * from processes, users limit 200;'; +export const BIG_QUERY = 'select * from processes, users limit 110;'; export const selectAllAgents = () => { cy.react('AgentsTable').find('input').should('not.be.disabled'); diff --git a/x-pack/plugins/osquery/public/action_results/action_results_summary.tsx b/x-pack/plugins/osquery/public/action_results/action_results_summary.tsx index 29d823560d6e3..81feb53fb4012 100644 --- a/x-pack/plugins/osquery/public/action_results/action_results_summary.tsx +++ b/x-pack/plugins/osquery/public/action_results/action_results_summary.tsx @@ -53,9 +53,8 @@ const ActionResultsSummaryComponent: React.FC = ({ skip: !hasActionResultsPrivileges, }); if (expired) { - // @ts-expect-error update types edges.forEach((edge) => { - if (!edge.fields.completed_at) { + if (!edge.fields?.completed_at && edge.fields) { edge.fields['error.keyword'] = edge.fields.error = [ i18n.translate('xpack.osquery.liveQueryActionResults.table.expiredErrorText', { defaultMessage: 'The action request timed out.', diff --git a/x-pack/plugins/osquery/public/action_results/use_action_privileges.tsx b/x-pack/plugins/osquery/public/action_results/use_action_privileges.tsx index 6d0477b22edee..83508def6a483 100644 --- a/x-pack/plugins/osquery/public/action_results/use_action_privileges.tsx +++ b/x-pack/plugins/osquery/public/action_results/use_action_privileges.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../common/lib/kibana'; export const useActionResultsPrivileges = () => { diff --git a/x-pack/plugins/osquery/public/action_results/use_action_results.ts b/x-pack/plugins/osquery/public/action_results/use_action_results.ts index 964feb9eafb3b..f950b4f1907c3 100644 --- a/x-pack/plugins/osquery/public/action_results/use_action_results.ts +++ b/x-pack/plugins/osquery/public/action_results/use_action_results.ts @@ -7,7 +7,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { flatten, reverse, uniqBy } from 'lodash/fp'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { lastValueFrom } from 'rxjs'; import type { InspectResponse } from '../common/helpers'; diff --git a/x-pack/plugins/osquery/public/actions/use_all_live_queries.ts b/x-pack/plugins/osquery/public/actions/use_all_live_queries.ts index f0fb0cd35ead6..a4bb5e5037a48 100644 --- a/x-pack/plugins/osquery/public/actions/use_all_live_queries.ts +++ b/x-pack/plugins/osquery/public/actions/use_all_live_queries.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { createFilter } from '../common/helpers'; diff --git a/x-pack/plugins/osquery/public/actions/use_live_query_details.ts b/x-pack/plugins/osquery/public/actions/use_live_query_details.ts index a31c493487057..b8703a8370d02 100644 --- a/x-pack/plugins/osquery/public/actions/use_live_query_details.ts +++ b/x-pack/plugins/osquery/public/actions/use_live_query_details.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/agent_policies/use_agent_policies.ts b/x-pack/plugins/osquery/public/agent_policies/use_agent_policies.ts index 5eb70c802140c..37f1789a964de 100644 --- a/x-pack/plugins/osquery/public/agent_policies/use_agent_policies.ts +++ b/x-pack/plugins/osquery/public/agent_policies/use_agent_policies.ts @@ -6,7 +6,7 @@ */ import { mapKeys } from 'lodash'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import type { GetAgentPoliciesResponseItem } from '@kbn/fleet-plugin/common'; diff --git a/x-pack/plugins/osquery/public/agent_policies/use_agent_policy.ts b/x-pack/plugins/osquery/public/agent_policies/use_agent_policy.ts index f629a138f70f6..7a819e1118ad2 100644 --- a/x-pack/plugins/osquery/public/agent_policies/use_agent_policy.ts +++ b/x-pack/plugins/osquery/public/agent_policies/use_agent_policy.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import type { AgentPolicy } from '@kbn/fleet-plugin/common'; diff --git a/x-pack/plugins/osquery/public/agents/use_agent_details.ts b/x-pack/plugins/osquery/public/agents/use_agent_details.ts index 59ac973eb1dc1..d75987f38e93b 100644 --- a/x-pack/plugins/osquery/public/agents/use_agent_details.ts +++ b/x-pack/plugins/osquery/public/agents/use_agent_details.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { GetOneAgentResponse } from '@kbn/fleet-plugin/common'; import { useErrorToast } from '../common/hooks/use_error_toast'; diff --git a/x-pack/plugins/osquery/public/agents/use_agent_groups.ts b/x-pack/plugins/osquery/public/agents/use_agent_groups.ts index 497819a15031d..156b439dcc18d 100644 --- a/x-pack/plugins/osquery/public/agents/use_agent_groups.ts +++ b/x-pack/plugins/osquery/public/agents/use_agent_groups.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { lastValueFrom } from 'rxjs'; import { useKibana } from '../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/agents/use_agent_policies.ts b/x-pack/plugins/osquery/public/agents/use_agent_policies.ts index 58032f8476f32..737a64226c2bc 100644 --- a/x-pack/plugins/osquery/public/agents/use_agent_policies.ts +++ b/x-pack/plugins/osquery/public/agents/use_agent_policies.ts @@ -6,8 +6,8 @@ */ import { mapKeys } from 'lodash'; -import type { UseQueryResult } from 'react-query'; -import { useQueries } from 'react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; +import { useQueries } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import type { GetOneAgentPolicyResponse } from '@kbn/fleet-plugin/common'; import { useKibana } from '../common/lib/kibana'; @@ -17,20 +17,21 @@ export const useAgentPolicies = (policyIds: string[] = []) => { const { http } = useKibana().services; const setErrorToast = useErrorToast(); - const agentResponse = useQueries( - policyIds.map((policyId) => ({ + const agentResponse = useQueries({ + queries: policyIds.map((policyId) => ({ queryKey: ['agentPolicy', policyId], queryFn: () => http.get(`/internal/osquery/fleet_wrapper/agent_policies/${policyId}`), enabled: policyIds.length > 0, onSuccess: () => setErrorToast(), + onError: (error: Error) => setErrorToast(error, { title: i18n.translate('xpack.osquery.action_policy_details.fetchError', { defaultMessage: 'Error while fetching policy details', }), }), - })) - ) as Array>; + })), + }) as Array>; const agentPoliciesLoading = agentResponse.some((p) => p.isLoading); const agentPolicies = agentResponse.map((p) => p.data?.item); diff --git a/x-pack/plugins/osquery/public/agents/use_agent_policy_agent_ids.ts b/x-pack/plugins/osquery/public/agents/use_agent_policy_agent_ids.ts index 4007f14ccc3e0..cd30baf32d52d 100644 --- a/x-pack/plugins/osquery/public/agents/use_agent_policy_agent_ids.ts +++ b/x-pack/plugins/osquery/public/agents/use_agent_policy_agent_ids.ts @@ -7,7 +7,7 @@ import { map } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { Agent } from '@kbn/fleet-plugin/common'; import { AGENTS_PREFIX } from '@kbn/fleet-plugin/common'; diff --git a/x-pack/plugins/osquery/public/agents/use_agent_status.ts b/x-pack/plugins/osquery/public/agents/use_agent_status.ts index dd733c27675cd..bc0d4e6323f62 100644 --- a/x-pack/plugins/osquery/public/agents/use_agent_status.ts +++ b/x-pack/plugins/osquery/public/agents/use_agent_status.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { GetAgentStatusResponse } from '@kbn/fleet-plugin/common'; import { useErrorToast } from '../common/hooks/use_error_toast'; diff --git a/x-pack/plugins/osquery/public/agents/use_all_agents.ts b/x-pack/plugins/osquery/public/agents/use_all_agents.ts index c5e7c2d703bcf..4f2aa8826f85f 100644 --- a/x-pack/plugins/osquery/public/agents/use_all_agents.ts +++ b/x-pack/plugins/osquery/public/agents/use_all_agents.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { ListResult, Agent } from '@kbn/fleet-plugin/common'; import { useErrorToast } from '../common/hooks/use_error_toast'; diff --git a/x-pack/plugins/osquery/public/agents/use_osquery_policies.ts b/x-pack/plugins/osquery/public/agents/use_osquery_policies.ts index 9ecf5d14c6b38..589deab5334b1 100644 --- a/x-pack/plugins/osquery/public/agents/use_osquery_policies.ts +++ b/x-pack/plugins/osquery/public/agents/use_osquery_policies.ts @@ -6,7 +6,7 @@ */ import { uniq } from 'lodash'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; import { useErrorToast } from '../common/hooks/use_error_toast'; diff --git a/x-pack/plugins/osquery/public/application.tsx b/x-pack/plugins/osquery/public/application.tsx index c57a9cb46795f..b8f8f504a5b5a 100644 --- a/x-pack/plugins/osquery/public/application.tsx +++ b/x-pack/plugins/osquery/public/application.tsx @@ -12,8 +12,8 @@ import ReactDOM from 'react-dom'; import { Router } from 'react-router-dom'; import { I18nProvider } from '@kbn/i18n-react'; import { ThemeProvider } from 'styled-components'; -import { QueryClientProvider } from 'react-query'; -import { ReactQueryDevtools } from 'react-query/devtools'; +import { QueryClientProvider } from '@tanstack/react-query'; +import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import type { Storage } from '@kbn/kibana-utils-plugin/public'; import type { AppMountParameters, CoreStart } from '@kbn/core/public'; diff --git a/x-pack/plugins/osquery/public/assets/use_assets_status.ts b/x-pack/plugins/osquery/public/assets/use_assets_status.ts index 28e752df6b2f4..0d082f29b0175 100644 --- a/x-pack/plugins/osquery/public/assets/use_assets_status.ts +++ b/x-pack/plugins/osquery/public/assets/use_assets_status.ts @@ -6,7 +6,7 @@ */ import type { SavedObject } from '@kbn/core/public'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../common/lib/kibana'; import { INTEGRATION_ASSETS_STATUS_ID } from './constants'; diff --git a/x-pack/plugins/osquery/public/assets/use_import_assets.ts b/x-pack/plugins/osquery/public/assets/use_import_assets.ts index feb2c48041567..4ae6d8549d6fa 100644 --- a/x-pack/plugins/osquery/public/assets/use_import_assets.ts +++ b/x-pack/plugins/osquery/public/assets/use_import_assets.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation, useQueryClient } from 'react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useKibana } from '../common/lib/kibana'; import { useErrorToast } from '../common/hooks/use_error_toast'; import { PACKS_ID } from '../packs/constants'; @@ -26,8 +26,8 @@ export const useImportAssets = ({ successToastText }: UseImportAssetsProps) => { return useMutation(() => http.post('/internal/osquery/assets/update'), { onSuccess: () => { setErrorToast(); - queryClient.invalidateQueries(PACKS_ID); - queryClient.invalidateQueries(INTEGRATION_ASSETS_STATUS_ID); + queryClient.invalidateQueries([PACKS_ID]); + queryClient.invalidateQueries([INTEGRATION_ASSETS_STATUS_ID]); toasts.addSuccess(successToastText); }, onError: (error) => { diff --git a/x-pack/plugins/osquery/public/common/hooks/use_logs_data_view.tsx b/x-pack/plugins/osquery/public/common/hooks/use_logs_data_view.tsx index 1ac76a54b6729..cf5a9e42d8911 100644 --- a/x-pack/plugins/osquery/public/common/hooks/use_logs_data_view.tsx +++ b/x-pack/plugins/osquery/public/common/hooks/use_logs_data_view.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { DataView } from '@kbn/data-plugin/common'; import { useKibana } from '../lib/kibana'; diff --git a/x-pack/plugins/osquery/public/common/hooks/use_osquery_integration.tsx b/x-pack/plugins/osquery/public/common/hooks/use_osquery_integration.tsx index 92f32d6535b4c..4602b8df24d78 100644 --- a/x-pack/plugins/osquery/public/common/hooks/use_osquery_integration.tsx +++ b/x-pack/plugins/osquery/public/common/hooks/use_osquery_integration.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../lib/kibana'; import { useErrorToast } from './use_error_toast'; @@ -16,7 +16,7 @@ export const useOsqueryIntegrationStatus = () => { const setErrorToast = useErrorToast(); return useQuery( - 'integration', + ['integration'], () => http.get<{ name: string; version: string; title: string; install_status: string }>( '/internal/osquery/status' diff --git a/x-pack/plugins/osquery/public/live_queries/use_create_live_query_action.tsx b/x-pack/plugins/osquery/public/live_queries/use_create_live_query_action.tsx index 72ac627b02a63..dfb08ddeda87d 100644 --- a/x-pack/plugins/osquery/public/live_queries/use_create_live_query_action.tsx +++ b/x-pack/plugins/osquery/public/live_queries/use_create_live_query_action.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation } from 'react-query'; +import { useMutation } from '@tanstack/react-query'; import type { AgentSelection } from '../../common/schemas/common'; import type { CreateLiveQueryRequestBodySchema } from '../../common/schemas/routes/live_query'; import { useKibana } from '../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/packs/active_state_switch.tsx b/x-pack/plugins/osquery/public/packs/active_state_switch.tsx index 41f7c7a32522e..cb67f248207fc 100644 --- a/x-pack/plugins/osquery/public/packs/active_state_switch.tsx +++ b/x-pack/plugins/osquery/public/packs/active_state_switch.tsx @@ -7,7 +7,7 @@ import { EuiSwitch, EuiLoadingSpinner } from '@elastic/eui'; import React, { useCallback, useMemo, useState } from 'react'; -import { useQueryClient } from 'react-query'; +import { useQueryClient } from '@tanstack/react-query'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; @@ -55,7 +55,7 @@ const ActiveStateSwitchComponent: React.FC = ({ item }) const { isLoading, mutateAsync } = useUpdatePack({ options: { onSuccess: (response) => { - queryClient.invalidateQueries(PACKS_ID); + queryClient.invalidateQueries([PACKS_ID]); setErrorToast(); toasts.addSuccess( response?.data?.attributes.enabled diff --git a/x-pack/plugins/osquery/public/packs/use_create_pack.ts b/x-pack/plugins/osquery/public/packs/use_create_pack.ts index b536f50075a86..26cf1fad2eeb9 100644 --- a/x-pack/plugins/osquery/public/packs/use_create_pack.ts +++ b/x-pack/plugins/osquery/public/packs/use_create_pack.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation, useQueryClient } from 'react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; @@ -42,7 +42,7 @@ export const useCreatePack = ({ withRedirect }: UseCreatePackProps) => { setErrorToast(error, { title: error.body.error, toastMessage: error.body.message }); }, onSuccess: (payload) => { - queryClient.invalidateQueries(PACKS_ID); + queryClient.invalidateQueries([PACKS_ID]); if (withRedirect) { navigateToApp(PLUGIN_ID, { path: pagePathGetters.packs() }); } diff --git a/x-pack/plugins/osquery/public/packs/use_delete_pack.ts b/x-pack/plugins/osquery/public/packs/use_delete_pack.ts index 439a850c785b0..8b5e7f0fb1450 100644 --- a/x-pack/plugins/osquery/public/packs/use_delete_pack.ts +++ b/x-pack/plugins/osquery/public/packs/use_delete_pack.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation, useQueryClient } from 'react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; @@ -36,7 +36,7 @@ export const useDeletePack = ({ packId, withRedirect }: UseDeletePackProps) => { }); }, onSuccess: () => { - queryClient.invalidateQueries(PACKS_ID); + queryClient.invalidateQueries([PACKS_ID]); if (withRedirect) { navigateToApp(PLUGIN_ID, { path: pagePathGetters.packs() }); } diff --git a/x-pack/plugins/osquery/public/packs/use_pack.ts b/x-pack/plugins/osquery/public/packs/use_pack.ts index da6062fb8309f..bedaceff9c63c 100644 --- a/x-pack/plugins/osquery/public/packs/use_pack.ts +++ b/x-pack/plugins/osquery/public/packs/use_pack.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../common/lib/kibana'; import type { PackItem } from './types'; diff --git a/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts b/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts index 1e57af58c46b4..95b2ddc7c9268 100644 --- a/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts +++ b/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { lastValueFrom } from 'rxjs'; import type { DataView } from '@kbn/data-plugin/common'; import { SortDirection } from '@kbn/data-plugin/common'; diff --git a/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts b/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts index 28b474530f4bc..15fbcce34a862 100644 --- a/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts +++ b/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import moment from 'moment-timezone'; import { lastValueFrom } from 'rxjs'; import { SortDirection } from '@kbn/data-plugin/common'; diff --git a/x-pack/plugins/osquery/public/packs/use_packs.ts b/x-pack/plugins/osquery/public/packs/use_packs.ts index b8fadaf571a84..05dd200b8f1c8 100644 --- a/x-pack/plugins/osquery/public/packs/use_packs.ts +++ b/x-pack/plugins/osquery/public/packs/use_packs.ts @@ -6,7 +6,7 @@ */ import type { SavedObjectsFindResponse } from '@kbn/core/public'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../common/lib/kibana'; import { PACKS_ID } from './constants'; diff --git a/x-pack/plugins/osquery/public/packs/use_update_pack.ts b/x-pack/plugins/osquery/public/packs/use_update_pack.ts index 1075078dd0e98..840d01e9b32fd 100644 --- a/x-pack/plugins/osquery/public/packs/use_update_pack.ts +++ b/x-pack/plugins/osquery/public/packs/use_update_pack.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseMutationOptions } from 'react-query'; -import { useMutation, useQueryClient } from 'react-query'; +import type { UseMutationOptions } from '@tanstack/react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; @@ -48,7 +48,7 @@ export const useUpdatePack = ({ withRedirect, options }: UseUpdatePackProps) => setErrorToast(error, { title: error?.body?.error, toastMessage: error?.body?.message }); }, onSuccess: (response) => { - queryClient.invalidateQueries(PACKS_ID); + queryClient.invalidateQueries([PACKS_ID]); if (withRedirect) { navigateToApp(PLUGIN_ID, { path: pagePathGetters.packs() }); } diff --git a/x-pack/plugins/osquery/public/query_client.ts b/x-pack/plugins/osquery/public/query_client.ts index a0ee6c71be288..41467404c7bff 100644 --- a/x-pack/plugins/osquery/public/query_client.ts +++ b/x-pack/plugins/osquery/public/query_client.ts @@ -5,14 +5,12 @@ * 2.0. */ -/* eslint-disable @typescript-eslint/no-empty-function */ +import { QueryClient } from '@tanstack/react-query'; -import { QueryClient, setLogger } from 'react-query'; - -setLogger({ - log: () => {}, - warn: () => {}, - error: () => {}, +export const queryClient = new QueryClient({ + logger: { + log: () => null, + warn: () => null, + error: () => null, + }, }); - -export const queryClient = new QueryClient(); diff --git a/x-pack/plugins/osquery/public/results/use_all_results.ts b/x-pack/plugins/osquery/public/results/use_all_results.ts index 94a80fb09734a..ee545a2eaf9e9 100644 --- a/x-pack/plugins/osquery/public/results/use_all_results.ts +++ b/x-pack/plugins/osquery/public/results/use_all_results.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { lastValueFrom } from 'rxjs'; diff --git a/x-pack/plugins/osquery/public/saved_queries/use_create_saved_query.ts b/x-pack/plugins/osquery/public/saved_queries/use_create_saved_query.ts index 7081fda6e4484..0d96e4a118736 100644 --- a/x-pack/plugins/osquery/public/saved_queries/use_create_saved_query.ts +++ b/x-pack/plugins/osquery/public/saved_queries/use_create_saved_query.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation, useQueryClient } from 'react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; @@ -41,7 +41,7 @@ export const useCreateSavedQuery = ({ withRedirect }: UseCreateSavedQueryProps) }); }, onSuccess: (response) => { - queryClient.invalidateQueries(SAVED_QUERIES_ID); + queryClient.invalidateQueries([SAVED_QUERIES_ID]); if (withRedirect) { navigateToApp(PLUGIN_ID, { path: pagePathGetters.saved_queries() }); } diff --git a/x-pack/plugins/osquery/public/saved_queries/use_delete_saved_query.ts b/x-pack/plugins/osquery/public/saved_queries/use_delete_saved_query.ts index e882a9ba2f1ea..f03ac709db1ee 100644 --- a/x-pack/plugins/osquery/public/saved_queries/use_delete_saved_query.ts +++ b/x-pack/plugins/osquery/public/saved_queries/use_delete_saved_query.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation, useQueryClient } from 'react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; @@ -35,7 +35,7 @@ export const useDeleteSavedQuery = ({ savedQueryId }: UseDeleteSavedQueryProps) }); }, onSuccess: () => { - queryClient.invalidateQueries(SAVED_QUERIES_ID); + queryClient.invalidateQueries([SAVED_QUERIES_ID]); navigateToApp(PLUGIN_ID, { path: pagePathGetters.saved_queries() }); toasts.addSuccess( i18n.translate('xpack.osquery.editSavedQuery.deleteSuccessToastMessageText', { diff --git a/x-pack/plugins/osquery/public/saved_queries/use_saved_queries.ts b/x-pack/plugins/osquery/public/saved_queries/use_saved_queries.ts index 53d07c52e325b..bceeaed5be435 100644 --- a/x-pack/plugins/osquery/public/saved_queries/use_saved_queries.ts +++ b/x-pack/plugins/osquery/public/saved_queries/use_saved_queries.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { SavedObjectsFindResponse } from '@kbn/core/public'; import { useKibana } from '../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/saved_queries/use_saved_query.ts b/x-pack/plugins/osquery/public/saved_queries/use_saved_query.ts index f146910f35c14..e5c39d76c94f2 100644 --- a/x-pack/plugins/osquery/public/saved_queries/use_saved_query.ts +++ b/x-pack/plugins/osquery/public/saved_queries/use_saved_query.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { PLUGIN_ID } from '../../common'; import { useKibana } from '../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/saved_queries/use_update_saved_query.ts b/x-pack/plugins/osquery/public/saved_queries/use_update_saved_query.ts index 95eb446e147bd..2e47ef1ef7c29 100644 --- a/x-pack/plugins/osquery/public/saved_queries/use_update_saved_query.ts +++ b/x-pack/plugins/osquery/public/saved_queries/use_update_saved_query.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation, useQueryClient } from 'react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; @@ -41,7 +41,7 @@ export const useUpdateSavedQuery = ({ savedQueryId }: UseUpdateSavedQueryProps) }); }, onSuccess: (payload: SavedQuerySO) => { - queryClient.invalidateQueries(SAVED_QUERIES_ID); + queryClient.invalidateQueries([SAVED_QUERIES_ID]); queryClient.invalidateQueries([SAVED_QUERY_ID, { savedQueryId }]); navigateToApp(PLUGIN_ID, { path: pagePathGetters.saved_queries() }); toasts.addSuccess( diff --git a/x-pack/plugins/osquery/public/shared_components/osquery_action/index.tsx b/x-pack/plugins/osquery/public/shared_components/osquery_action/index.tsx index 3cffdbde50dd1..15c6fa645de11 100644 --- a/x-pack/plugins/osquery/public/shared_components/osquery_action/index.tsx +++ b/x-pack/plugins/osquery/public/shared_components/osquery_action/index.tsx @@ -7,7 +7,7 @@ import { EuiErrorBoundary, EuiLoadingContent, EuiEmptyPrompt, EuiCode } from '@elastic/eui'; import React, { useMemo } from 'react'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import type { CoreStart } from '@kbn/core/public'; import { AGENT_STATUS_ERROR, diff --git a/x-pack/plugins/osquery/public/shared_components/osquery_action/osquery_action.test.tsx b/x-pack/plugins/osquery/public/shared_components/osquery_action/osquery_action.test.tsx index 4c9214ca3ea14..927d408884d20 100644 --- a/x-pack/plugins/osquery/public/shared_components/osquery_action/osquery_action.test.tsx +++ b/x-pack/plugins/osquery/public/shared_components/osquery_action/osquery_action.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { render } from '@testing-library/react'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import { OsqueryAction } from '.'; import { queryClient } from '../../query_client'; diff --git a/x-pack/plugins/rule_registry/common/mapping_from_field_map.ts b/x-pack/plugins/rule_registry/common/mapping_from_field_map.ts index 4833631f09adb..1b66496bee19b 100644 --- a/x-pack/plugins/rule_registry/common/mapping_from_field_map.ts +++ b/x-pack/plugins/rule_registry/common/mapping_from_field_map.ts @@ -6,7 +6,7 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { FieldMap } from './field_map/types'; export function mappingFromFieldMap( diff --git a/x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type.test.ts b/x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type.test.ts index fefffd204c4a3..e602c0228f886 100644 --- a/x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type.test.ts +++ b/x-pack/plugins/rule_registry/server/utils/create_lifecycle_rule_type.test.ts @@ -73,6 +73,7 @@ function createRule(shouldWriteAlerts: boolean = true) { scheduleActions, } as any; }, + hasReachedAlertLimit: () => false, done: () => ({ getRecoveredAlerts: () => [] }), }; diff --git a/x-pack/plugins/security/public/authentication/access_agreement/__snapshots__/access_agreement_page.test.tsx.snap b/x-pack/plugins/security/public/authentication/access_agreement/__snapshots__/access_agreement_page.test.tsx.snap index 04dd39c69e64d..2735c8d14d1a1 100644 --- a/x-pack/plugins/security/public/authentication/access_agreement/__snapshots__/access_agreement_page.test.tsx.snap +++ b/x-pack/plugins/security/public/authentication/access_agreement/__snapshots__/access_agreement_page.test.tsx.snap @@ -2,42 +2,18 @@ exports[`AccessAgreementPage renders as expected when state is available 1`] = ` - -

- - This is - - - - link - - -

- + link + +

`; diff --git a/x-pack/plugins/security/public/authentication/login/components/login_form/__snapshots__/login_form.test.tsx.snap b/x-pack/plugins/security/public/authentication/login/components/login_form/__snapshots__/login_form.test.tsx.snap index d6eb4c20b8003..9e150c2ff0312 100644 --- a/x-pack/plugins/security/public/authentication/login/components/login_form/__snapshots__/login_form.test.tsx.snap +++ b/x-pack/plugins/security/public/authentication/login/components/login_form/__snapshots__/login_form.test.tsx.snap @@ -2,103 +2,49 @@ exports[`LoginForm login selector properly switches to login form -> login help and back: Login Help 1`] = ` - -

- - - some help - - -

-
+ some help + +

`; exports[`LoginForm login selector properly switches to login help: Login Help 1`] = ` - -

- - - some help - - -

-
+ some help + +

`; exports[`LoginForm properly switches to login help: Login Help 1`] = ` - -

- - - some help - - -

-
+ some help + +

`; diff --git a/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.test.tsx b/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.test.tsx index 514e9aa5e306c..c4f3000277af7 100644 --- a/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.test.tsx +++ b/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.test.tsx @@ -89,7 +89,9 @@ describe('apiKeysManagementApp', () => {
`); - unmount!(); + act(() => { + unmount!(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); expect(container).toMatchInlineSnapshot(`
`); diff --git a/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.test.tsx b/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.test.tsx index 04db6c58c27d1..c085bafb562c2 100644 --- a/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.test.tsx @@ -82,7 +82,9 @@ describe('roleMappingsManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); @@ -105,7 +107,9 @@ describe('roleMappingsManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); @@ -133,7 +137,9 @@ describe('roleMappingsManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); diff --git a/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx b/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx index 327499c64bb76..a6e06351f38c9 100644 --- a/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx @@ -88,7 +88,9 @@ describe('rolesManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); @@ -108,7 +110,9 @@ describe('rolesManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); @@ -133,7 +137,9 @@ describe('rolesManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); @@ -158,7 +164,9 @@ describe('rolesManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); diff --git a/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.tsx b/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.tsx index 231ef70fed5bf..5fbb81bd7e106 100644 --- a/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.tsx +++ b/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.tsx @@ -204,8 +204,7 @@ export const EditUserPage: FunctionComponent = ({ username }) diff --git a/x-pack/plugins/security_solution/cypress/integration/exceptions/add_edit_data_view_exception.spec.ts b/x-pack/plugins/security_solution/cypress/integration/exceptions/add_edit_data_view_exception.spec.ts new file mode 100644 index 0000000000000..c818f4e51060f --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/integration/exceptions/add_edit_data_view_exception.spec.ts @@ -0,0 +1,159 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getException } from '../../objects/exception'; +import { getNewRule } from '../../objects/rule'; + +import { ALERTS_COUNT, EMPTY_ALERT_TABLE, NUMBER_OF_ALERTS } from '../../screens/alerts'; + +import { addExceptionFromFirstAlert, goToClosedAlerts, goToOpenedAlerts } from '../../tasks/alerts'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; +import { goToRuleDetails } from '../../tasks/alerts_detection_rules'; +import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; +import { esArchiverLoad, esArchiverUnload, esArchiverResetKibana } from '../../tasks/es_archiver'; +import { login, visitWithoutDateRange } from '../../tasks/login'; +import { + addsException, + addsExceptionFromRuleSettings, + editException, + goToAlertsTab, + goToExceptionsTab, + removeException, + waitForTheRuleToBeExecuted, +} from '../../tasks/rule_details'; + +import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation'; +import { deleteAlertsAndRules, postDataView } from '../../tasks/common'; +import { + EXCEPTION_EDIT_FLYOUT_SAVE_BTN, + EXCEPTION_ITEM_CONTAINER, + FIELD_INPUT, +} from '../../screens/exceptions'; +import { + addExceptionEntryFieldValueOfItemX, + addExceptionEntryFieldValueValue, +} from '../../tasks/exceptions'; + +describe('Adds rule exception using data views', () => { + const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '1 alert'; + + before(() => { + esArchiverResetKibana(); + esArchiverLoad('exceptions'); + login(); + + postDataView('exceptions-*'); + }); + + beforeEach(() => { + deleteAlertsAndRules(); + createCustomRuleEnabled( + { + ...getNewRule(), + customQuery: 'agent.name:*', + dataSource: { dataView: 'exceptions-*', type: 'dataView' }, + }, + 'rule_testing', + '1s' + ); + visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); + goToRuleDetails(); + waitForTheRuleToBeExecuted(); + waitForAlertsToPopulate(); + }); + + afterEach(() => { + esArchiverUnload('exceptions_2'); + }); + + after(() => { + esArchiverUnload('exceptions'); + }); + + it('Creates an exception from an alert and deletes it', () => { + cy.get(ALERTS_COUNT).should('exist'); + cy.get(NUMBER_OF_ALERTS).should('have.text', NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS); + // Create an exception from the alerts actions menu that matches + // the existing alert + addExceptionFromFirstAlert(); + addsException(getException()); + + // Alerts table should now be empty from having added exception and closed + // matching alert + cy.get(EMPTY_ALERT_TABLE).should('exist'); + + // Closed alert should appear in table + goToClosedAlerts(); + cy.get(ALERTS_COUNT).should('exist'); + cy.get(NUMBER_OF_ALERTS).should('have.text', `${NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS}`); + + // Remove the exception and load an event that would have matched that exception + // to show that said exception now starts to show up again + goToExceptionsTab(); + removeException(); + esArchiverLoad('exceptions_2'); + goToAlertsTab(); + goToOpenedAlerts(); + waitForTheRuleToBeExecuted(); + waitForAlertsToPopulate(); + + cy.get(ALERTS_COUNT).should('exist'); + cy.get(NUMBER_OF_ALERTS).should('have.text', `${NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS}`); + }); + + it('Creates an exception from a rule and deletes it', () => { + // Create an exception from the exception tab that matches + // the existing alert + goToExceptionsTab(); + addsExceptionFromRuleSettings(getException()); + + // Alerts table should now be empty from having added exception and closed + // matching alert + goToAlertsTab(); + cy.get(EMPTY_ALERT_TABLE).should('exist'); + + // Closed alert should appear in table + goToClosedAlerts(); + cy.get(ALERTS_COUNT).should('exist'); + cy.get(NUMBER_OF_ALERTS).should('have.text', `${NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS}`); + + // Remove the exception and load an event that would have matched that exception + // to show that said exception now starts to show up again + goToExceptionsTab(); + removeException(); + esArchiverLoad('exceptions_2'); + goToAlertsTab(); + goToOpenedAlerts(); + waitForTheRuleToBeExecuted(); + waitForAlertsToPopulate(); + + cy.get(ALERTS_COUNT).should('exist'); + cy.get(NUMBER_OF_ALERTS).should('have.text', `${NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS}`); + }); + + it('Edits an exception', () => { + goToExceptionsTab(); + addsExceptionFromRuleSettings(getException()); + + editException(); + + // check that the existing item's field is being populated + cy.get(EXCEPTION_ITEM_CONTAINER) + .eq(0) + .find(FIELD_INPUT) + .eq(0) + .should('have.text', 'agent.name'); + + // check that you can select a different field + addExceptionEntryFieldValueOfItemX('user.name{downarrow}{enter}', 0, 0); + addExceptionEntryFieldValueValue('test', 0); + + cy.get(EXCEPTION_EDIT_FLYOUT_SAVE_BTN).click(); + cy.get(EXCEPTION_EDIT_FLYOUT_SAVE_BTN).should('have.attr', 'disabled'); + cy.get(EXCEPTION_EDIT_FLYOUT_SAVE_BTN).should('not.exist'); + }); +}); diff --git a/x-pack/plugins/security_solution/cypress/tasks/api_calls/rules.ts b/x-pack/plugins/security_solution/cypress/tasks/api_calls/rules.ts index 0ef07195b3309..655efbd2353fc 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/api_calls/rules.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/api_calls/rules.ts @@ -154,6 +154,31 @@ export const createCustomRuleEnabled = ( headers: { 'kbn-xsrf': 'cypress-creds' }, failOnStatusCode: false, }); + } else if (rule.dataSource.type === 'dataView') { + cy.request({ + method: 'POST', + url: 'api/detection_engine/rules', + body: { + rule_id: ruleId, + risk_score: parseInt(rule.riskScore, 10), + description: rule.description, + interval, + name: rule.name, + severity: rule.severity.toLocaleLowerCase(), + type: 'query', + from: 'now-50000h', + index: [], + data_view_id: rule.dataSource.dataView, + query: rule.customQuery, + language: 'kuery', + enabled: true, + tags: ['rule1'], + max_signals: maxSignals, + building_block_type: rule.buildingBlockType, + }, + headers: { 'kbn-xsrf': 'cypress-creds' }, + failOnStatusCode: false, + }); } }; diff --git a/x-pack/plugins/security_solution/cypress/tasks/common.ts b/x-pack/plugins/security_solution/cypress/tasks/common.ts index 4982053648667..cd9525e95b0b2 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/common.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/common.ts @@ -185,6 +185,7 @@ export const postDataView = (dataSource: string) => { url: `/api/index_patterns/index_pattern`, body: { index_pattern: { + id: dataSource, fieldAttrs: '{}', title: dataSource, timeFieldName: '@timestamp', diff --git a/x-pack/plugins/security_solution/public/app/home/global_header/index.test.tsx b/x-pack/plugins/security_solution/public/app/home/global_header/index.test.tsx index ff082a27e575e..48f1109e33443 100644 --- a/x-pack/plugins/security_solution/public/app/home/global_header/index.test.tsx +++ b/x-pack/plugins/security_solution/public/app/home/global_header/index.test.tsx @@ -48,7 +48,7 @@ jest.mock('../../../common/containers/sourcerer/use_signal_helpers', () => ({ jest.mock('react-reverse-portal', () => ({ InPortal: ({ children }: { children: React.ReactNode }) => <>{children}, OutPortal: ({ children }: { children: React.ReactNode }) => <>{children}, - createPortalNode: () => ({ unmount: jest.fn() }), + createHtmlPortalNode: () => ({ unmount: jest.fn() }), })); describe('global header', () => { diff --git a/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx b/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx index e585cf18ca156..08b3888130836 100644 --- a/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx +++ b/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx @@ -12,7 +12,7 @@ import { } from '@elastic/eui'; import React, { useCallback, useEffect, useMemo } from 'react'; import { useLocation } from 'react-router-dom'; -import { createPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; +import { createHtmlPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; import { i18n } from '@kbn/i18n'; import type { AppMountParameters } from '@kbn/core/public'; @@ -39,7 +39,7 @@ const BUTTON_ADD_DATA = i18n.translate('xpack.securitySolution.globalHeader.butt */ export const GlobalHeader = React.memo( ({ setHeaderActionMenu }: { setHeaderActionMenu: AppMountParameters['setHeaderActionMenu'] }) => { - const portalNode = useMemo(() => createPortalNode(), []); + const portalNode = useMemo(() => createHtmlPortalNode(), []); const { theme, http: { diff --git a/x-pack/plugins/security_solution/public/app/home/template_wrapper/bottom_bar/index.tsx b/x-pack/plugins/security_solution/public/app/home/template_wrapper/bottom_bar/index.tsx index 407c0db35f49d..123ae4563f756 100644 --- a/x-pack/plugins/security_solution/public/app/home/template_wrapper/bottom_bar/index.tsx +++ b/x-pack/plugins/security_solution/public/app/home/template_wrapper/bottom_bar/index.tsx @@ -8,7 +8,7 @@ /* eslint-disable react/display-name */ import React from 'react'; -import type { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template'; import type { AppLeaveHandler } from '@kbn/core/public'; import { TimelineId } from '../../../../../common/types/timeline'; import { AutoSaveWarningMsg } from '../../../../timelines/components/timeline/auto_save_warning'; diff --git a/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx b/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx index 21db51173ca20..79c7a0899e9c6 100644 --- a/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx +++ b/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx @@ -10,7 +10,7 @@ import styled from 'styled-components'; import { EuiPanel, EuiThemeProvider, useEuiTheme } from '@elastic/eui'; import { IS_DRAGGING_CLASS_NAME } from '@kbn/securitysolution-t-grid'; import type { AppLeaveHandler } from '@kbn/core/public'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { useSecuritySolutionNavigation } from '../../../common/components/navigation/use_security_solution_navigation'; import { TimelineId } from '../../../../common/types/timeline'; import { getTimelineShowStatusByIdSelector } from '../../../timelines/components/flyout/selectors'; diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/threat_summary_view.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/threat_summary_view.test.tsx index 94c2aa6bc9e8d..b87c96c34632a 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/threat_summary_view.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/threat_summary_view.test.tsx @@ -24,7 +24,7 @@ jest.mock('../../../lib/kibana', () => ({ }), })); -jest.mock('../table/action_cell'); +jest.mock('../table/action_cell', () => ({ ActionCell: () => <> })); jest.mock('../table/field_name_cell'); describe('ThreatSummaryView', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/event_details.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/event_details.test.tsx index cb4affec563d5..eb034eca172dc 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/event_details.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/event_details.test.tsx @@ -6,6 +6,7 @@ */ import { waitFor } from '@testing-library/dom'; +import { mount } from 'enzyme'; import type { ReactWrapper } from 'enzyme'; import React from 'react'; @@ -15,7 +16,6 @@ import { mockDetailItemData, mockDetailItemDataId, rawEventData, TestProviders } import { EventDetails, EventsViewType } from './event_details'; import { mockBrowserFields } from '../../containers/source/mock'; -import { useMountAppended } from '../../utils/use_mount_appended'; import { mockAlertDetailsData } from './__mocks__'; import type { TimelineEventsDetailsItem } from '../../../../common/search_strategy'; import { TimelineTabs } from '../../../../common/types/timeline'; @@ -44,7 +44,6 @@ jest.mock('../../../detections/containers/detection_engine/rules/use_rule_with_f jest.mock('../link_to'); describe('EventDetails', () => { - const mount = useMountAppended(); const defaultProps = { browserFields: mockBrowserFields, data: mockDetailItemData, diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/mock_state.ts b/x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/mock_state.ts index 4b51ae9f329a7..3d54f078e7087 100644 --- a/x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/mock_state.ts +++ b/x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/mock_state.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { pipe } from 'lodash/fp'; import { mockGlobalState } from '../../../mock'; diff --git a/x-pack/plugins/security_solution/public/common/components/filters_global/__snapshots__/filters_global.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/filters_global/__snapshots__/filters_global.test.tsx.snap index 4dd14f56997eb..f6734aa75add9 100644 --- a/x-pack/plugins/security_solution/public/common/components/filters_global/__snapshots__/filters_global.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/common/components/filters_global/__snapshots__/filters_global.test.tsx.snap @@ -2,7 +2,16 @@ exports[`rendering renders correctly 1`] = ` } + node={ + Object { + "element":
, + "elementType": "html", + "getInitialPortalProps": [Function], + "mount": [Function], + "setPortalProps": [Function], + "unmount": [Function], + } + } > ({ +jest.mock('../../hooks/use_space_id', () => ({ useSpaceId: jest.fn().mockReturnValue('myspace'), })); diff --git a/x-pack/plugins/security_solution/public/common/components/open_in_dev_console/index.tsx b/x-pack/plugins/security_solution/public/common/components/open_in_dev_console/index.tsx index e56cc391e7ec7..2b8c25adf3e8f 100644 --- a/x-pack/plugins/security_solution/public/common/components/open_in_dev_console/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/open_in_dev_console/index.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; import { EuiButton, EuiFlexItem, EuiToolTip } from '@elastic/eui'; -import { useSpaceId } from '../../../risk_score/containers/common'; +import { useSpaceId } from '../../hooks/use_space_id'; interface OpenInDevConsoleButtonProps { enableButton: boolean; diff --git a/x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx b/x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx index e833f1f1a5dbd..b85cd2949de59 100644 --- a/x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import { getOr } from 'lodash/fp'; import React, { memo, useEffect, useCallback, useMemo } from 'react'; import type { ConnectedProps } from 'react-redux'; diff --git a/x-pack/plugins/security_solution/public/common/components/toasters/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/toasters/index.test.tsx index bb42e99d50518..bf2249fac5c83 100644 --- a/x-pack/plugins/security_solution/public/common/components/toasters/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/toasters/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import { cloneDeep } from 'lodash/fp'; import { mount } from 'enzyme'; import React, { useEffect } from 'react'; diff --git a/x-pack/plugins/security_solution/public/common/containers/alerts/use_alert_prevalence_from_process_tree.ts b/x-pack/plugins/security_solution/public/common/containers/alerts/use_alert_prevalence_from_process_tree.ts index 4ea3ff08c2abd..1a59271614c57 100644 --- a/x-pack/plugins/security_solution/public/common/containers/alerts/use_alert_prevalence_from_process_tree.ts +++ b/x-pack/plugins/security_solution/public/common/containers/alerts/use_alert_prevalence_from_process_tree.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useHttp } from '../../lib/kibana'; import { useTimelineDataFilters } from '../../../timelines/containers/use_timeline_data_filters'; diff --git a/x-pack/plugins/security_solution/public/common/containers/query_client/query_client_provider.tsx b/x-pack/plugins/security_solution/public/common/containers/query_client/query_client_provider.tsx index 20fd3d09ad593..7feaf9c8653ef 100644 --- a/x-pack/plugins/security_solution/public/common/containers/query_client/query_client_provider.tsx +++ b/x-pack/plugins/security_solution/public/common/containers/query_client/query_client_provider.tsx @@ -7,7 +7,7 @@ import type { PropsWithChildren } from 'react'; import React, { memo, useMemo } from 'react'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; type QueryClientOptionsProp = ConstructorParameters[0]; diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_global_header_portal.tsx b/x-pack/plugins/security_solution/public/common/hooks/use_global_header_portal.tsx index 8e8d73ff12849..c240f102d5e67 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/use_global_header_portal.tsx +++ b/x-pack/plugins/security_solution/public/common/hooks/use_global_header_portal.tsx @@ -6,12 +6,12 @@ */ import { useState } from 'react'; -import { createPortalNode } from 'react-reverse-portal'; +import { createHtmlPortalNode } from 'react-reverse-portal'; /** * A singleton portal for rendering content in the global header */ -const globalKQLHeaderPortalNodeSingleton = createPortalNode(); +const globalKQLHeaderPortalNodeSingleton = createHtmlPortalNode(); export const useGlobalHeaderPortal = () => { const [globalKQLHeaderPortalNode] = useState(globalKQLHeaderPortalNodeSingleton); diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/common/index.ts b/x-pack/plugins/security_solution/public/common/hooks/use_space_id.ts similarity index 91% rename from x-pack/plugins/security_solution/public/risk_score/containers/common/index.ts rename to x-pack/plugins/security_solution/public/common/hooks/use_space_id.ts index 1277c08aee5a0..55debc6f80215 100644 --- a/x-pack/plugins/security_solution/public/risk_score/containers/common/index.ts +++ b/x-pack/plugins/security_solution/public/common/hooks/use_space_id.ts @@ -6,7 +6,7 @@ */ import { useState, useEffect } from 'react'; -import { useKibana } from '../../../common/lib/kibana'; +import { useKibana } from '../lib/kibana'; export const useSpaceId = () => { const { spaces } = useKibana().services; diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_timeline_events_count.tsx b/x-pack/plugins/security_solution/public/common/hooks/use_timeline_events_count.tsx index e801db0190799..e6e744fdd4b2e 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/use_timeline_events_count.tsx +++ b/x-pack/plugins/security_solution/public/common/hooks/use_timeline_events_count.tsx @@ -6,13 +6,13 @@ */ import React, { useState } from 'react'; -import { createPortalNode, OutPortal } from 'react-reverse-portal'; +import { createHtmlPortalNode, OutPortal } from 'react-reverse-portal'; /** * A singleton portal for rendering content in the global header */ -const timelineEventsCountPortalNodeSingleton = createPortalNode(); -const eqlEventsCountPortalNodeSingleton = createPortalNode(); +const timelineEventsCountPortalNodeSingleton = createHtmlPortalNode(); +const eqlEventsCountPortalNodeSingleton = createHtmlPortalNode(); export const useTimelineEventsCountPortal = () => { const [timelineEventsCountPortalNode] = useState(timelineEventsCountPortalNodeSingleton); diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts b/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts index b7c22f4398f91..4a736fc622055 100644 --- a/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts +++ b/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts @@ -11,7 +11,7 @@ import { useCallback, useEffect, useState, useRef } from 'react'; import { i18n } from '@kbn/i18n'; import { camelCase, isArray, isObject } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import type { AuthenticatedUser } from '@kbn/security-plugin/common/model'; import type { Capabilities, NavigateToAppOptions } from '@kbn/core/public'; import type { CasesPermissions } from '@kbn/cases-plugin/common/ui'; diff --git a/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx b/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx index b4987a6080342..4ed453a4ce0a3 100644 --- a/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx +++ b/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx @@ -13,7 +13,7 @@ import type { RenderOptions, RenderResult } from '@testing-library/react'; import { render as reactRender } from '@testing-library/react'; import type { Action, Reducer, Store } from 'redux'; import type { AppDeepLink } from '@kbn/core/public'; -import { QueryClient, QueryClientProvider, setLogger } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { coreMock } from '@kbn/core/public/mocks'; import { PLUGIN_ID } from '@kbn/fleet-plugin/common'; import type { RenderHookOptions, RenderHookResult } from '@testing-library/react-hooks'; @@ -22,7 +22,7 @@ import type { ReactHooksRenderer, WrapperComponent, } from '@testing-library/react-hooks/src/types/react'; -import type { UseBaseQueryResult } from 'react-query/types/react/types'; +import type { UseBaseQueryResult } from '@tanstack/react-query'; import ReactDOM from 'react-dom'; import { ConsoleManager } from '../../../management/components/console'; import type { StartPlugins, StartServices } from '../../../types'; @@ -89,7 +89,6 @@ export type WaitForReactHookState = | 'isSuccess' | 'isLoading' | 'isError' - | 'isIdle' | 'isLoadingError' | 'isStale' | 'isFetched' @@ -117,15 +116,6 @@ export type ReactQueryHookRenderer< options?: RenderHookOptions ) => Promise; -// hide react-query output in console -setLogger({ - error: () => {}, - // eslint-disable-next-line no-console - log: console.log, - // eslint-disable-next-line no-console - warn: console.warn, -}); - /** * Mocked app root context renderer */ @@ -228,6 +218,14 @@ export const createAppRootMockRenderer = (): AppContextTestRender => { cacheTime: Infinity, }, }, + // hide react-query output in console + logger: { + error: () => {}, + // eslint-disable-next-line no-console + log: console.log, + // eslint-disable-next-line no-console + warn: console.warn, + }, }); const AppWrapper: React.FC<{ children: React.ReactElement }> = ({ children }) => ( diff --git a/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx b/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx index 41d68949daccb..3907232cc1120 100644 --- a/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx +++ b/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx @@ -16,7 +16,7 @@ import type { Store } from 'redux'; import { BehaviorSubject } from 'rxjs'; import { ThemeProvider } from 'styled-components'; import type { Capabilities } from '@kbn/core/public'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { ConsoleManager } from '../../management/components/console'; import type { State } from '../store'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.test.tsx index 9a62fd58a0fbc..5e07dadf02492 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { renderHook, cleanup } from '@testing-library/react-hooks'; import { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.ts index 4a37f55dc1d6a..8c0a698eac43f 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import type { GetRuleExecutionEventsResponse } from '../../../../../common/detection_engine/rule_monitoring'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.test.tsx index 63565f7cfa1b5..ddb553998584f 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { renderHook, cleanup } from '@testing-library/react-hooks'; import { useExecutionResults } from './use_execution_results'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.tsx index a07289969af12..001c0bc153961 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import type { GetRuleExecutionResultsResponse } from '../../../../../common/detection_engine/rule_monitoring'; diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx index fe2eabec1ea0b..41153cb6b188a 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx @@ -331,7 +331,7 @@ export const AddExceptionFlyoutWrapper: React.FC /** * This should be re-visited after UEBA work is merged */ - const useRuleIndices = useMemo(() => { + const memoRuleIndices = useMemo(() => { if (enrichedAlert != null && enrichedAlert['kibana.alert.rule.parameters']?.index != null) { return Array.isArray(enrichedAlert['kibana.alert.rule.parameters'].index) ? enrichedAlert['kibana.alert.rule.parameters'].index @@ -341,8 +341,8 @@ export const AddExceptionFlyoutWrapper: React.FC ? enrichedAlert.signal.rule.index : [enrichedAlert.signal.rule.index]; } - return ruleIndices; - }, [enrichedAlert, ruleIndices]); + return []; + }, [enrichedAlert]); const memoDataViewId = useMemo(() => { if ( @@ -359,7 +359,7 @@ export const AddExceptionFlyoutWrapper: React.FC , index: number) => { - event.persist(); const values = field.value as string[]; const value = event.target.value; field.setValue([...values.slice(0, index), value, ...values.slice(index + 1)]); diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.test.tsx index 9ce7134db5f2a..705c7f5f3fbd3 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.test.tsx @@ -9,7 +9,7 @@ jest.mock('../../../containers/detection_engine/rules/api'); jest.mock('../../../../common/lib/kibana'); import React from 'react'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { renderHook, cleanup } from '@testing-library/react-hooks'; import { useInstalledIntegrations } from './use_installed_integrations'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.tsx index bc9e837911233..734ef6e628214 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { InstalledIntegrationArray } from '../../../../../common/detection_engine/schemas/common'; import { fetchInstalledIntegrations } from '../../../containers/detection_engine/rules/api'; // import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx index 1cccca810f7e0..c0698ba443d8b 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx @@ -150,7 +150,7 @@ export const RuleActionsField: React.FC = ({ field, messageVariables }) = <> - + {fieldErrors} diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/index.tsx index 3f541344abe5a..0639fda39ca4d 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/index.tsx @@ -101,6 +101,13 @@ const PreviewButton = styled(EuiButton)` const defaultTimeRange: Unit = 'h'; +const refreshedTimeframe = (startDate: string, endDate: string) => { + return { + start: dateMath.parse(startDate) || moment().subtract(1, 'hour'), + end: dateMath.parse(endDate) || moment(), + }; +}; + const RulePreviewComponent: React.FC = ({ index, indexPattern, @@ -129,9 +136,20 @@ const RulePreviewComponent: React.FC = ({ } }, [spaces]); + // Raw timeframe as a string const [startDate, setStartDate] = useState('now-1h'); const [endDate, setEndDate] = useState('now'); + // Parsed timeframe as a Moment object + const [timeframeStart, setTimeframeStart] = useState(moment().subtract(1, 'hour')); + const [timeframeEnd, setTimeframeEnd] = useState(moment()); + + useEffect(() => { + const { start, end } = refreshedTimeframe(startDate, endDate); + setTimeframeStart(start); + setTimeframeEnd(end); + }, [startDate, endDate]); + const { form } = useForm({ defaultValue: advancedOptionsDefaultValue, options: { stripEmptyFields: false }, @@ -180,21 +198,22 @@ const RulePreviewComponent: React.FC = ({ const showAdvancedOptions = queryPreviewIdSelected === ADVANCED_QUERY_SELECT_ID; const advancedOptions = useMemo( () => - showAdvancedOptions && startDate && endDate && formInterval && formLookback + showAdvancedOptions && formInterval && formLookback ? { - timeframeStart: dateMath.parse(startDate) || moment().subtract(1, 'hour'), - timeframeEnd: dateMath.parse(endDate) || moment(), + timeframeStart, + timeframeEnd, interval: formInterval, lookback: formLookback, } : undefined, - [endDate, formInterval, formLookback, showAdvancedOptions, startDate] + [formInterval, formLookback, showAdvancedOptions, timeframeEnd, timeframeStart] ); const [timeFrame, setTimeFrame] = useState(defaultTimeRange); const { addNoiseWarning, createPreview, + clearPreview, isPreviewRequestInProgress, previewId, logs, @@ -228,10 +247,27 @@ const RulePreviewComponent: React.FC = ({ const { startTransaction } = useStartTransaction(); + const [isRefreshing, setIsRefreshing] = useState(false); + useEffect(() => { + if (!isRefreshing) { + return; + } + createPreview(); + setIsRefreshing(false); + }, [isRefreshing, createPreview]); + const handlePreviewClick = useCallback(() => { startTransaction({ name: SINGLE_RULE_ACTIONS.PREVIEW }); - createPreview(); - }, [createPreview, startTransaction]); + if (showAdvancedOptions) { + // Refresh timeframe on Preview button click to make sure that relative times recalculated based on current time + const { start, end } = refreshedTimeframe(startDate, endDate); + setTimeframeStart(start); + setTimeframeEnd(end); + } else { + clearPreview(); + } + setIsRefreshing(true); + }, [clearPreview, endDate, showAdvancedOptions, startDate, startTransaction]); const onTimeChange = useCallback( ({ start: newStart, end: newEnd, isInvalid }: OnTimeChangeProps) => { diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/use_preview_route.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/use_preview_route.tsx index d0c543e3c3a31..7c5c3e673fd2a 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/use_preview_route.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/use_preview_route.tsx @@ -5,7 +5,8 @@ * 2.0. */ -import { useEffect, useState, useCallback } from 'react'; +import { useEffect, useMemo, useState, useCallback } from 'react'; +import moment from 'moment'; import type { Unit } from '@kbn/datemath'; import type { Type, ThreatMapping } from '@kbn/securitysolution-io-ts-alerting-types'; import type { FieldValueQueryBar } from '../query_bar'; @@ -60,8 +61,23 @@ export const usePreviewRoute = ({ }: PreviewRouteParams) => { const [isRequestTriggered, setIsRequestTriggered] = useState(false); + const [timeframeEnd, setTimeframeEnd] = useState(moment()); + useEffect(() => { + if (isRequestTriggered) { + setTimeframeEnd(moment()); + } + }, [isRequestTriggered, setTimeframeEnd]); + + const quickQueryOptions = useMemo( + () => ({ + timeframe: timeFrame, + timeframeEnd, + }), + [timeFrame, timeframeEnd] + ); + const { isLoading, showInvocationCountWarning, response, rule, setRule } = usePreviewRule({ - timeframe: timeFrame, + quickQueryOptions, advancedOptions, }); const [logs, setLogs] = useState(response.logs ?? []); diff --git a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx index 01e676189f79e..6a83df5a87d19 100644 --- a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx @@ -474,14 +474,13 @@ describe('take action dropdown', () => { await waitFor(() => { expect(apiMocks.responseProvider.metadataDetails).toHaveBeenCalled(); - }); - - wrapper.update(); + wrapper.update(); - expect(findLaunchResponderButton().first().prop('disabled')).toBe(true); - expect(findLaunchResponderButton().first().prop('toolTipContent')).toEqual( - HOST_ENDPOINT_UNENROLLED_TOOLTIP - ); + expect(findLaunchResponderButton().first().prop('disabled')).toBe(true); + expect(findLaunchResponderButton().first().prop('toolTipContent')).toEqual( + HOST_ENDPOINT_UNENROLLED_TOOLTIP + ); + }); }); }); }); diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_find_rules_query.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_find_rules_query.ts index e78be9ca1c753..523a05012ca19 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_find_rules_query.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_find_rules_query.ts @@ -6,8 +6,8 @@ */ import { useCallback } from 'react'; -import type { UseQueryOptions } from 'react-query'; -import { useQuery, useQueryClient } from 'react-query'; +import type { UseQueryOptions } from '@tanstack/react-query'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import { fetchRules } from './api'; import * as i18n from './translations'; @@ -78,9 +78,8 @@ export const useInvalidateRules = () => { * Invalidate all queries that start with FIND_RULES_QUERY_KEY. This * includes the in-memory query cache and paged query cache. */ - queryClient.invalidateQueries(FIND_RULES_QUERY_KEY, { - refetchActive: true, - refetchInactive: false, + queryClient.invalidateQueries([FIND_RULES_QUERY_KEY], { + refetchType: 'active', }); }, [queryClient]); }; @@ -104,7 +103,7 @@ export const useUpdateRulesCache = () => { return useCallback( (newRules: Rule[]) => { queryClient.setQueriesData['data']>( - FIND_RULES_QUERY_KEY, + [FIND_RULES_QUERY_KEY], (currentData) => currentData ? { diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_install_pre_packaged_rules.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_install_pre_packaged_rules.ts index ff3493037182c..3f56cac04fb02 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_install_pre_packaged_rules.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_install_pre_packaged_rules.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useMutation } from 'react-query'; +import { useMutation } from '@tanstack/react-query'; import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import { createPrepackagedRules } from './api'; import * as i18n from './translations'; diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx index f977e15626c16..5cddbeef63028 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - import { act, renderHook } from '@testing-library/react-hooks'; import { shallow } from 'enzyme'; import type { ReactElement } from 'react'; @@ -144,6 +143,7 @@ describe('usePrePackagedRules', () => { result.current.createPrePackagedRules(); await waitForNextUpdate(); expect(api.createPrepackagedRules).toHaveBeenCalled(); + await waitForNextUpdate(); expect(result.current).toEqual({ getLoadPrebuiltRulesAndTemplatesButton: result.current.getLoadPrebuiltRulesAndTemplatesButton, diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules_status.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules_status.ts index 02350d84ec99e..c01bce4fe8bc2 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules_status.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules_status.ts @@ -5,7 +5,7 @@ * 2.0. */ import { useCallback } from 'react'; -import { useQuery, useQueryClient } from 'react-query'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import { getPrePackagedRulesStatus } from './api'; import * as i18n from './translations'; @@ -62,9 +62,8 @@ export const useInvalidatePrePackagedRulesStatus = () => { const queryClient = useQueryClient(); return useCallback(() => { - queryClient.invalidateQueries(PRE_PACKAGED_RULES_STATUS_QUERY_KEY, { - refetchActive: true, - refetchInactive: false, + queryClient.invalidateQueries([PRE_PACKAGED_RULES_STATUS_QUERY_KEY], { + refetchType: 'active', }); }, [queryClient]); }; diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_preview_rule.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_preview_rule.ts index a8b12a9ebc121..ed7f4150f7349 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_preview_rule.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_preview_rule.ts @@ -8,7 +8,6 @@ import { useEffect, useMemo, useState } from 'react'; import moment from 'moment'; -import type { Unit } from '@kbn/datemath'; import { RULE_PREVIEW_FROM, RULE_PREVIEW_INTERVAL, @@ -23,7 +22,10 @@ import type { import { previewRule } from './api'; import * as i18n from './translations'; import { transformOutput } from './transforms'; -import type { AdvancedPreviewOptions } from '../../../pages/detection_engine/rules/types'; +import type { + AdvancedPreviewOptions, + QuickQueryPreviewOptions, +} from '../../../pages/detection_engine/rules/types'; import { getTimeTypeValue } from '../../../pages/detection_engine/rules/create/helpers'; const REASONABLE_INVOCATION_COUNT = 200; @@ -35,10 +37,10 @@ const emptyPreviewRule: PreviewResponse = { }; export const usePreviewRule = ({ - timeframe = 'h', + quickQueryOptions, advancedOptions, }: { - timeframe: Unit; + quickQueryOptions: QuickQueryPreviewOptions; advancedOptions?: AdvancedPreviewOptions; }) => { const [rule, setRule] = useState(null); @@ -49,7 +51,7 @@ export const usePreviewRule = ({ let interval: string = RULE_PREVIEW_INTERVAL.HOUR; let from: string = RULE_PREVIEW_FROM.HOUR; - switch (timeframe) { + switch (quickQueryOptions.timeframe) { case 'd': invocationCount = RULE_PREVIEW_INVOCATION_COUNT.DAY; interval = RULE_PREVIEW_INTERVAL.DAY; @@ -67,8 +69,11 @@ export const usePreviewRule = ({ break; } const timeframeEnd = useMemo( - () => (advancedOptions ? advancedOptions.timeframeEnd.toISOString() : moment().toISOString()), - [advancedOptions] + () => + advancedOptions + ? advancedOptions.timeframeEnd.toISOString() + : quickQueryOptions.timeframeEnd.toISOString(), + [advancedOptions, quickQueryOptions] ); if (advancedOptions) { diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/bulk_actions/use_bulk_actions_dry_run.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/bulk_actions/use_bulk_actions_dry_run.ts index 4468b1c65ece0..28c4e4be608dc 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/bulk_actions/use_bulk_actions_dry_run.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/bulk_actions/use_bulk_actions_dry_run.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseMutateAsyncFunction } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutateAsyncFunction } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { BulkAction, diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts index ce4060dcf6e87..93910509193e2 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts @@ -19,6 +19,7 @@ import type { import type { Filter } from '@kbn/es-query'; import type { RuleAction } from '@kbn/alerting-plugin/common'; import type { DataViewListItem } from '@kbn/data-views-plugin/common'; +import type { Unit } from '@kbn/datemath'; import type { RuleAlertAction } from '../../../../../common/detection_engine/types'; import type { FieldValueQueryBar } from '../../../components/rules/query_bar'; @@ -242,6 +243,11 @@ export interface ActionsStepRuleJson { meta?: unknown; } +export interface QuickQueryPreviewOptions { + timeframe: Unit; + timeframeEnd: moment.Moment; +} + export interface AdvancedPreviewForm { interval: string; lookback: string; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.test.tsx b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.test.tsx index 7a95a328606cb..ee3ac4a907ee4 100644 --- a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.test.tsx @@ -146,7 +146,9 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { let getByTestId: typeof renderResult['getByTestId']; beforeEach(async () => { - await render(); + await act(async () => { + await render(); + }); getByTestId = renderResult.getByTestId; @@ -166,34 +168,38 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { } }); - it('should disable all buttons while an update is in flight', () => { - expect(getByTestId('testPage-flyout-cancelButton')).not.toBeEnabled(); - expect(getByTestId('testPage-flyout-submitButton')).not.toBeEnabled(); + it('should disable all buttons while an update is in flight', async () => { + await waitFor(() => { + expect(getByTestId('testPage-flyout-cancelButton')).not.toBeEnabled(); + expect(getByTestId('testPage-flyout-submitButton')).not.toBeEnabled(); + }); }); - it('should display loading indicator on Submit while an update is in flight', () => { - expect( - getByTestId('testPage-flyout-submitButton').querySelector('.euiLoadingSpinner') - ).toBeTruthy(); + it('should display loading indicator on Submit while an update is in flight', async () => { + await waitFor(() => + expect( + getByTestId('testPage-flyout-submitButton').querySelector('.euiLoadingSpinner') + ).toBeTruthy() + ); }); - it('should pass `disabled=true` to the Form component while an update is in flight', () => { - expect(getLastFormComponentProps().disabled).toBe(true); + it('should pass `disabled=true` to the Form component while an update is in flight', async () => { + await waitFor(() => expect(getLastFormComponentProps().disabled).toBe(true)); }); }); describe('and submit is successful', () => { beforeEach(async () => { - await render(); + await act(async () => { + await render(); + }); act(() => { userEvent.click(renderResult.getByTestId('testPage-flyout-submitButton')); }); - await act(async () => { - await waitFor(() => { - expect(renderResult.queryByTestId('testPage-flyout')).toBeNull(); - }); + await waitFor(() => { + expect(renderResult.queryByTestId('testPage-flyout')).toBeNull(); }); }); @@ -209,25 +215,25 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { }); describe('and submit fails', () => { - beforeEach(async () => { + beforeEach(() => { const _renderAndWaitForFlyout = render; render = async (...args) => { - mockedApi.responseProvider.trustedAppCreate.mockImplementation(() => { - throw new Error('oh oh. no good!'); - }); + mockedApi.responseProvider.trustedAppCreate.mockRejectedValue( + new Error('oh oh. no good!') as never + ); - await _renderAndWaitForFlyout(...args); + await act(async () => { + await _renderAndWaitForFlyout(...args); + }); act(() => { userEvent.click(renderResult.getByTestId('testPage-flyout-submitButton')); }); - await act(async () => { - await waitFor(() => - expect(mockedApi.responseProvider.trustedAppCreate).toHaveBeenCalled() - ); - }); + await waitFor(() => + expect(mockedApi.responseProvider.trustedAppCreate).toHaveBeenCalled() + ); return renderResult; }; @@ -270,7 +276,9 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { return new ExceptionsListItemGenerator().generateTrustedApp(item); }); - await render({ onFormSubmit: handleSubmitCallback }); + await act(async () => { + await render({ onFormSubmit: handleSubmitCallback }); + }); act(() => { userEvent.click(renderResult.getByTestId('testPage-flyout-submitButton')); @@ -319,8 +327,10 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { }); describe('and in Edit mode', () => { - beforeEach(async () => { - history.push('somepage?show=edit&itemId=123'); + beforeEach(() => { + act(() => { + history.push('somepage?show=edit&itemId=123'); + }); }); it('should show loader while initializing in edit mode', async () => { @@ -355,10 +365,8 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { it('should provide Form component with the item for edit', async () => { const { getByTestId } = await render(); - await act(async () => { - await waitFor(() => { - expect(getByTestId('formMock')).toBeTruthy(); - }); + await waitFor(() => { + expect(getByTestId('formMock')).toBeTruthy(); }); const expectedProps = { @@ -373,37 +381,34 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { expectedProps.entries ) as ExceptionListItemSchema['entries']; - expect(getLastFormComponentProps().item).toEqual(expectedProps); + await waitFor(() => { + expect(getLastFormComponentProps().item).toEqual(expectedProps); + }); }); it('should show error toast and close flyout if item for edit does not exist', async () => { - mockedApi.responseProvider.trustedApp.mockImplementation(() => { - throw new Error('does not exist'); - }); - - await render(); + mockedApi.responseProvider.trustedApp.mockRejectedValue(new Error('does not exist') as never); await act(async () => { - await waitFor(() => { - expect(mockedApi.responseProvider.trustedApp).toHaveBeenCalled(); - }); + await render(); }); - expect(coreStart.notifications.toasts.addWarning).toHaveBeenCalledWith( - 'Failed to retrieve item for edit. Reason: does not exist' - ); + await waitFor(() => { + expect(mockedApi.responseProvider.trustedApp).toHaveBeenCalled(); + + expect(coreStart.notifications.toasts.addWarning).toHaveBeenCalledWith( + 'Failed to retrieve item for edit. Reason: does not exist' + ); + }); }); it('should not show the expired license callout', async () => { const { queryByTestId, getByTestId } = await render(); - await act(async () => { - await waitFor(() => { - expect(getByTestId('formMock')).toBeTruthy(); - }); + await waitFor(() => { + expect(getByTestId('formMock')).toBeTruthy(); + expect(queryByTestId('testPage-flyout-expiredLicenseCallout')).not.toBeTruthy(); }); - - expect(queryByTestId('testPage-flyout-expiredLicenseCallout')).not.toBeTruthy(); }); it('should show expired license warning when unsupported features are being used (downgrade scenario)', async () => { @@ -425,13 +430,10 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { const { getByTestId } = await render(); - await act(async () => { - await waitFor(() => { - expect(getByTestId('formMock')).toBeTruthy(); - }); + await waitFor(() => { + expect(getByTestId('formMock')).toBeTruthy(); + expect(getByTestId('testPage-flyout-expiredLicenseCallout')).toBeTruthy(); }); - - expect(getByTestId('testPage-flyout-expiredLicenseCallout')).toBeTruthy(); }); }); }); diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx index e0ec473d22dad..4d9f53c73341e 100644 --- a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx @@ -231,7 +231,7 @@ export const ArtifactFlyout = memo( }, [externalSubmitHandlerError, internalSubmitError, submitHandler]); const { - isLoading: isLoadingItemForEdit, + isRefetching: isLoadingItemForEdit, error, refetch: fetchItemForEdit, } = useGetArtifact(apiClient, urlParams.itemId ?? '', undefined, { diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts index 1f343142ee18e..813e205b64c9a 100644 --- a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts @@ -7,7 +7,7 @@ import { useEffect, useMemo, useState } from 'react'; import type { Pagination } from '@elastic/eui'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { ServerApiError } from '../../../../common/types'; import { useIsMounted } from '../../../hooks/use_is_mounted'; import { MANAGEMENT_PAGE_SIZE_OPTIONS } from '../../../common/constants'; diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/bad_argument.tsx b/x-pack/plugins/security_solution/public/management/components/console/components/bad_argument.tsx index 2d07932e388b4..b6085ed5356c0 100644 --- a/x-pack/plugins/security_solution/public/management/components/console/components/bad_argument.tsx +++ b/x-pack/plugins/security_solution/public/management/components/console/components/bad_argument.tsx @@ -31,7 +31,7 @@ export const BadArgument = memo + (({ commands, display = 'defaul {commandsByGroups.map((commandsByGroup) => { const groupLabel = commandsByGroup[0].helpGroupLabel; const filteredCommands = getFilteredCommands(commandsByGroup); + + if (filteredCommands.length === 0) { + return null; + } + return ( props.theme.eui.euiCodeFontFamily}; +`; export const ConsoleCodeBlock = memo<{ children: ReactNode; inline?: boolean; - textColor?: 'default' | 'error' | 'success'; + textColor?: EuiTextProps['color']; bold?: boolean; }>(({ children, inline = false, textColor = 'default', bold = false }) => { - const baseStyledComponent = inline ? EuiTextColor : EuiText; - - const CodeBlock = euiStyled(baseStyledComponent).attrs({ - transparentBackground: true, - size: 's', - })`{ - color: ${(props) => { - if (textColor === 'error') { - return props.theme.eui.euiColorDanger; - } else if (textColor === 'success') { - return props.theme.eui.euiColorSuccessText; - } else { - return props.theme.eui.euiColorDarkestShade; - } - }}; - font-weight: ${(props) => { - return bold ? props.theme.eui.euiFontWeightBold : props.theme.eui.euiFontWeightRegular; - }}; - font-family: ${(props) => props.theme.eui.euiCodeFontFamily}; - padding: 0; - } - `; - - return {children}; + return ( + + {bold ? {children} : children} + + ); }); ConsoleCodeBlock.displayName = 'ConsoleCodeBlock'; diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/unknown_comand.tsx b/x-pack/plugins/security_solution/public/management/components/console/components/unknown_comand.tsx index 7041b2e166f47..117ac7f8438aa 100644 --- a/x-pack/plugins/security_solution/public/management/components/console/components/unknown_comand.tsx +++ b/x-pack/plugins/security_solution/public/management/components/console/components/unknown_comand.tsx @@ -56,7 +56,7 @@ export const UnknownCommand = memo(({ command, s return ( + { describe('when using parseCommandInput()', () => { @@ -145,21 +145,4 @@ describe('when using parsed command input utils', () => { ); }); }); - - describe('when using parsedPidOrEntityIdParameter()', () => { - it('should parse a pid as a number and return proper params', () => { - const parameters = parsedPidOrEntityIdParameter({ pid: ['123'] }); - expect(parameters).toEqual({ pid: 123 }); - }); - - it('should parse an entity id correctly and return proper params', () => { - const parameters = parsedPidOrEntityIdParameter({ entityId: ['123qwe'] }); - expect(parameters).toEqual({ entity_id: '123qwe' }); - }); - - it('should return undefined if no params are defined', () => { - const parameters = parsedPidOrEntityIdParameter({}); - expect(parameters).toEqual(undefined); - }); - }); }); diff --git a/x-pack/plugins/security_solution/public/management/components/console/service/parsed_command_input.ts b/x-pack/plugins/security_solution/public/management/components/console/service/parsed_command_input.ts index 984dd77eb4786..32477e6783832 100644 --- a/x-pack/plugins/security_solution/public/management/components/console/service/parsed_command_input.ts +++ b/x-pack/plugins/security_solution/public/management/components/console/service/parsed_command_input.ts @@ -8,7 +8,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import type { CommandDefinition } from '..'; -import type { EndpointActionDataParameterTypes } from '../../../../../common/endpoint/types'; export type ParsedArgData = string[]; @@ -185,16 +184,3 @@ export const getArgumentsForCommand = (command: CommandDefinition): string[] => ? [buildArgumentText({ required: requiredArgs, optional: optionalArgs })] : []; }; - -export const parsedPidOrEntityIdParameter = (parameters: { - pid?: ParsedArgData; - entityId?: ParsedArgData; -}): EndpointActionDataParameterTypes => { - if (parameters.pid) { - return { pid: Number(parameters.pid[0]) }; - } else if (parameters.entityId) { - return { entity_id: parameters.entityId[0] }; - } - - return undefined; -}; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/kill_process_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/kill_process_action.tsx index 111575a94521b..fd749bb1562db 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/kill_process_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/kill_process_action.tsx @@ -8,6 +8,7 @@ import React, { memo, useEffect } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import type { IHttpFetchError } from '@kbn/core-http-browser'; +import { parsedPidOrEntityIdParameter } from './utils'; import { ActionSuccess } from './action_success'; import type { ActionDetails, @@ -17,7 +18,6 @@ import { useGetActionDetails } from '../../hooks/endpoint/use_get_action_details import type { EndpointCommandDefinitionMeta } from './types'; import { useSendKillProcessRequest } from '../../hooks/endpoint/use_send_kill_process_endpoint_request'; import type { CommandExecutionComponentProps } from '../console/types'; -import { parsedPidOrEntityIdParameter } from '../console/service/parsed_command_input'; import { ActionError } from './action_error'; import { ACTION_DETAILS_REFRESH_INTERVAL } from './constants'; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx index de8987f47ea55..b75a480765844 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx @@ -46,7 +46,7 @@ export const EndpointStatusActionResult = memo< error: fetchedDetailsError, isFetching, isFetched, - } = useGetEndpointDetails(endpointId, { enabled: isPending, queryKey }); + } = useGetEndpointDetails(endpointId, { enabled: isPending, queryKey: [queryKey] }); const { data: fetchedPendingActionsSummary } = useGetEndpointPendingActionsSummary([endpointId], { enabled: isPending, diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/suspend_process_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/suspend_process_action.tsx index 10c3a7d1a4a0d..d29dd4cbdee02 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/suspend_process_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/suspend_process_action.tsx @@ -8,6 +8,7 @@ import React, { memo, useEffect } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import type { IHttpFetchError } from '@kbn/core-http-browser'; +import { parsedPidOrEntityIdParameter } from './utils'; import { ActionSuccess } from './action_success'; import type { ActionDetails, @@ -17,7 +18,6 @@ import { useGetActionDetails } from '../../hooks/endpoint/use_get_action_details import type { EndpointCommandDefinitionMeta } from './types'; import { useSendSuspendProcessRequest } from '../../hooks/endpoint/use_send_suspend_process_endpoint_request'; import type { CommandExecutionComponentProps } from '../console/types'; -import { parsedPidOrEntityIdParameter } from '../console/service/parsed_command_input'; import { ActionError } from './action_error'; import { ACTION_DETAILS_REFRESH_INTERVAL } from './constants'; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.test.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.test.ts new file mode 100644 index 0000000000000..ab84e9de959f0 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.test.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { parsedPidOrEntityIdParameter } from './utils'; + +describe('Endpoint Responder - Utilities', () => { + describe('when using parsedPidOrEntityIdParameter()', () => { + it('should parse a pid as a number and return proper params', () => { + const parameters = parsedPidOrEntityIdParameter({ pid: ['123'] }); + expect(parameters).toEqual({ pid: 123 }); + }); + + it('should parse an entity id correctly and return proper params', () => { + const parameters = parsedPidOrEntityIdParameter({ entityId: ['123qwe'] }); + expect(parameters).toEqual({ entity_id: '123qwe' }); + }); + + it('should return undefined if no params are defined', () => { + const parameters = parsedPidOrEntityIdParameter({}); + expect(parameters).toEqual(undefined); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.ts new file mode 100644 index 0000000000000..9ebcd090bd2a0 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import type { EndpointActionDataParameterTypes } from '../../../../common/endpoint/types'; + +export const parsedPidOrEntityIdParameter = (parameters: { + pid?: string[]; + entityId?: string[]; +}): EndpointActionDataParameterTypes => { + if (parameters.pid) { + return { pid: Number(parameters.pid[0]) }; + } else if (parameters.entityId) { + return { entity_id: parameters.entityId[0] }; + } + + return undefined; +}; diff --git a/x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_wrapper.test.tsx b/x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_wrapper.test.tsx index f9fe611869a85..7bc3e5ac0be6d 100644 --- a/x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_wrapper.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_wrapper.test.tsx @@ -28,7 +28,15 @@ import { jest.mock('../../hooks/endpoint/use_get_endpoint_policy_response'); jest.mock('../../hooks/endpoint/use_get_endpoint_details'); -describe('when on the policy response', () => { +// FLAKY: https://github.com/elastic/kibana/issues/136272 +// FLAKY: https://github.com/elastic/kibana/issues/139033 +// FLAKY: https://github.com/elastic/kibana/issues/139032 +// FLAKY: https://github.com/elastic/kibana/issues/139031 +// FLAKY: https://github.com/elastic/kibana/issues/139030 +// FLAKY: https://github.com/elastic/kibana/issues/139028 +// FLAKY: https://github.com/elastic/kibana/issues/139029 +// FLAKY: https://github.com/elastic/kibana/issues/139027 +describe.skip('when on the policy response', () => { const docGenerator = new EndpointDocGenerator(); const createPolicyResponse = ( overallStatus: HostPolicyResponseActionStatus = HostPolicyResponseActionStatus.success, diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx index e75402ae98427..aef46affd4252 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx @@ -7,8 +7,8 @@ import pMap from 'p-map'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx index fdbe6a451dc44..be99fb5f1abb8 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx @@ -10,8 +10,8 @@ import type { UpdateExceptionListItemSchema, ExceptionListItemSchema, } from '@kbn/securitysolution-io-ts-list-types'; -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx index fa807e2d93438..63a41492b2699 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx @@ -9,8 +9,8 @@ import type { ExceptionListItemSchema, } from '@kbn/securitysolution-io-ts-list-types'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx index de3b4c386bc3f..9b366d033caf5 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx @@ -6,8 +6,8 @@ */ import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx index 7ce83d84c9394..58b0cd1c16e73 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx @@ -6,8 +6,8 @@ */ import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { QueryObserverResult, UseQueryOptions } from 'react-query'; -import { useQuery } from 'react-query'; +import type { QueryObserverResult, UseQueryOptions } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; export function useGetArtifact( diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx index 4064c9bdeb82e..0c751cd6525cb 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx @@ -6,8 +6,8 @@ */ import type { FoundExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { QueryObserverResult, UseQueryOptions } from 'react-query'; -import { useQuery } from 'react-query'; +import type { QueryObserverResult, UseQueryOptions } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import { useMemo } from 'react'; import { MANAGEMENT_DEFAULT_PAGE, diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx index 36fc65a309fa6..da4dcf765a8c9 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx @@ -6,8 +6,8 @@ */ import type { ExceptionListSummarySchema } from '@kbn/securitysolution-io-ts-list-types'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { QueryObserverResult, UseQueryOptions } from 'react-query'; -import { useQuery } from 'react-query'; +import type { QueryObserverResult, UseQueryOptions } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import { parsePoliciesAndFilterToKql, parseQueryFilterToKQL } from '../../common/utils'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; import { DEFAULT_EXCEPTION_LIST_ITEM_SEARCHABLE_FIELDS } from '../../../../common/endpoint/service/artifacts/constants'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx index 910f2228040a0..ad0791f94f687 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx @@ -9,8 +9,8 @@ import type { ExceptionListItemSchema, } from '@kbn/securitysolution-io-ts-list-types'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.test.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.test.ts index b04e0428037cf..381bd906f58f5 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.test.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.test.ts @@ -11,12 +11,12 @@ import { useGetActionDetails } from './use_get_action_details'; import { responseActionsHttpMocks } from '../../mocks/response_actions_http_mocks'; import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; import { ACTION_DETAILS_ROUTE } from '../../../../common/endpoint/constants'; -import { useQuery as _useQuery } from 'react-query'; +import { useQuery as _useQuery } from '@tanstack/react-query'; const useQueryMock = _useQuery as jest.Mock; -jest.mock('react-query', () => { - const actualReactQueryModule = jest.requireActual('react-query'); +jest.mock('@tanstack/react-query', () => { + const actualReactQueryModule = jest.requireActual('@tanstack/react-query'); return { ...actualReactQueryModule, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.ts index 5bc85d8007176..8336c46e2b232 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.ts @@ -5,9 +5,9 @@ * 2.0. */ -import type { UseQueryOptions, UseQueryResult } from 'react-query'; +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useHttp } from '../../../common/lib/kibana'; import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; import { ACTION_DETAILS_ROUTE } from '../../../../common/endpoint/constants'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.test.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.test.ts index 8ff8a6f43d11e..d039890256a3d 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.test.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.test.ts @@ -9,13 +9,13 @@ import type { AppContextTestRender, ReactQueryHookRenderer } from '../../../comm import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; import { useGetEndpointActionList } from './use_get_endpoint_action_list'; import { ENDPOINTS_ACTION_LIST_ROUTE } from '../../../../common/endpoint/constants'; -import { useQuery as _useQuery } from 'react-query'; +import { useQuery as _useQuery } from '@tanstack/react-query'; import { responseActionsHttpMocks } from '../../mocks/response_actions_http_mocks'; const useQueryMock = _useQuery as jest.Mock; -jest.mock('react-query', () => { - const actualReactQueryModule = jest.requireActual('react-query'); +jest.mock('@tanstack/react-query', () => { + const actualReactQueryModule = jest.requireActual('@tanstack/react-query'); return { ...actualReactQueryModule, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.ts index e0a1e1c1a2485..58420993cb788 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.ts @@ -5,9 +5,9 @@ * 2.0. */ -import type { UseQueryOptions, UseQueryResult } from 'react-query'; +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { EndpointActionListRequestQuery } from '../../../../common/endpoint/schema/actions'; import { useHttp } from '../../../common/lib/kibana'; import { ENDPOINTS_ACTION_LIST_ROUTE } from '../../../../common/endpoint/constants'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts index b9771f7dee3dd..ce8b08014686e 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts @@ -10,13 +10,13 @@ import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; import { useGetEndpointDetails } from './use_get_endpoint_details'; import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; import { HOST_METADATA_GET_ROUTE } from '../../../../common/endpoint/constants'; -import { useQuery as _useQuery } from 'react-query'; +import { useQuery as _useQuery } from '@tanstack/react-query'; import { endpointMetadataHttpMocks } from '../../pages/endpoint_hosts/mocks'; const useQueryMock = _useQuery as jest.Mock; -jest.mock('react-query', () => { - const actualReactQueryModule = jest.requireActual('react-query'); +jest.mock('@tanstack/react-query', () => { + const actualReactQueryModule = jest.requireActual('@tanstack/react-query'); return { ...actualReactQueryModule, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.ts index e81e8b716ea9c..68d53372e9dd3 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseQueryOptions, UseQueryResult } from 'react-query'; -import { useQuery } from 'react-query'; +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; import { useHttp } from '../../../common/lib/kibana'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.test.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.test.ts index b36cf686d67f5..6bc17c8794616 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.test.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.test.ts @@ -9,13 +9,13 @@ import type { AppContextTestRender, ReactQueryHookRenderer } from '../../../comm import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; import { useGetEndpointPendingActionsSummary } from './use_get_endpoint_pending_actions_summary'; import { ACTION_STATUS_ROUTE } from '../../../../common/endpoint/constants'; -import { useQuery as _useQuery } from 'react-query'; +import { useQuery as _useQuery } from '@tanstack/react-query'; import { responseActionsHttpMocks } from '../../mocks/response_actions_http_mocks'; const useQueryMock = _useQuery as jest.Mock; -jest.mock('react-query', () => { - const actualReactQueryModule = jest.requireActual('react-query'); +jest.mock('@tanstack/react-query', () => { + const actualReactQueryModule = jest.requireActual('@tanstack/react-query'); return { ...actualReactQueryModule, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.ts index 3254e743da44a..cee29041b0354 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { QueryObserverResult, UseQueryOptions } from 'react-query'; -import { useQuery } from 'react-query'; +import type { QueryObserverResult, UseQueryOptions } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { PendingActionsResponse } from '../../../../common/endpoint/types'; import { fetchPendingActionsByAgentId } from '../../../common/lib/endpoint_pending_actions'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.tsx b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.tsx index 7a67d5a446bac..a930dd43eecd4 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.tsx @@ -5,8 +5,8 @@ * 2.0. */ import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { UseQueryResult, UseQueryOptions } from 'react-query'; -import { useQuery } from 'react-query'; +import type { UseQueryResult, UseQueryOptions } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import { useHttp } from '../../../common/lib/kibana'; import { BASE_POLICY_RESPONSE_ROUTE } from '../../../../common/endpoint/constants'; import type { GetHostPolicyResponse } from '../../../../common/endpoint/types'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_endpoint_processes_request.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_endpoint_processes_request.ts index aa3f2b69c807b..8fa97e75dc6be 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_endpoint_processes_request.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_endpoint_processes_request.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { ProcessesRequestBody, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_isolate_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_isolate_endpoint_request.ts index d4ca621a1fc16..b0fb5029ab15d 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_isolate_endpoint_request.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_isolate_endpoint_request.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import { isolateHost } from '../../../common/lib/endpoint_isolation'; import type { diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_kill_process_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_kill_process_endpoint_request.ts index a049d35c21f5c..2d86f15f81d40 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_kill_process_endpoint_request.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_kill_process_endpoint_request.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { KillOrSuspendProcessRequestBody, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_release_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_release_endpoint_request.ts index aaf6e6ab71944..f6d45393ae885 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_release_endpoint_request.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_release_endpoint_request.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { HostIsolationRequestBody, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_suspend_process_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_suspend_process_endpoint_request.ts index 483b0d53e1d6b..d6c2f56cb627f 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_suspend_process_endpoint_request.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_suspend_process_endpoint_request.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { useMutation } from 'react-query'; -import type { UseMutationOptions, UseMutationResult } from 'react-query'; +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { KillOrSuspendProcessRequestBody, diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx index bc8ce0c6a3216..f4eac8de48805 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx @@ -5,8 +5,7 @@ * 2.0. */ import React from 'react'; -import { act, cleanup } from '@testing-library/react'; -import { fireEvent } from '@testing-library/dom'; +import { act, cleanup, fireEvent } from '@testing-library/react'; import { stubIndexPattern } from '@kbn/data-plugin/common/stubs'; import { useFetchIndex } from '../../../../../common/containers/source'; import { NAME_ERROR } from '../event_filters_list'; @@ -187,9 +186,7 @@ describe('Event filter form', () => { render(); expect(renderResult.queryByText(NAME_ERROR)).toBeNull(); const nameInput = renderResult.getByTestId(`${formPrefix}-name-input`); - act(() => { - fireEvent.blur(nameInput); - }); + fireEvent.blur(nameInput); rerenderWithLatestProps(); expect(renderResult.queryByText(NAME_ERROR)).not.toBeNull(); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.test.tsx b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.test.tsx index 43245b340e47c..b60cdf6040b1d 100644 --- a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.test.tsx @@ -63,24 +63,12 @@ describe('When on the host isolation exceptions entry form', () => { ).resolves.toHaveLength(10); }); - await act(async () => { - await waitFor(() => { - userEvent.click( - renderResult.getByTestId('hostIsolationExceptionsListPage-pageAddButton') - ); - }); - }); - - await act(async () => { - await waitFor(() => { - expect(renderResult.getByTestId('hostIsolationExceptions-form')).toBeTruthy(); - }); + userEvent.click(renderResult.getByTestId('hostIsolationExceptionsListPage-pageAddButton')); - await waitFor(() => { - expect(fleetApiMock.responseProvider.endpointPackagePolicyList).toHaveBeenCalled(); - }); + await waitFor(() => { + expect(renderResult.getByTestId('hostIsolationExceptions-form')).toBeTruthy(); + expect(fleetApiMock.responseProvider.endpointPackagePolicyList).toHaveBeenCalled(); }); - return renderResult; }; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.test.tsx index 6bb63fb96c62a..37f04ff804c1d 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.test.tsx @@ -20,6 +20,7 @@ import { PolicyArtifactsDeleteModal } from './policy_artifacts_delete_modal'; import { exceptionsListAllHttpMocks } from '../../../../../mocks/exceptions_list_http_mocks'; import { ExceptionsListApiClient } from '../../../../../services/exceptions_list/exceptions_list_api_client'; import { POLICY_ARTIFACT_DELETE_MODAL_LABELS } from './translations'; +import { getDeferred } from '../../../../../components/mocks'; const listType: Array = [ 'endpoint_events', @@ -80,6 +81,8 @@ describe.each(listType)('Policy details %s artifact delete modal', (type) => { }); it('should disable the submit button while deleting ', async () => { + const deferred = getDeferred(); + mockedApi.responseProvider.exceptionUpdate.mockDelay.mockReturnValue(deferred.promise); await render(); const confirmButton = renderResult.getByTestId('confirmModalConfirmButton'); userEvent.click(confirmButton); @@ -87,6 +90,10 @@ describe.each(listType)('Policy details %s artifact delete modal', (type) => { await waitFor(() => { expect(confirmButton).toBeDisabled(); }); + + await act(async () => { + deferred.resolve(); // cleanup + }); }); it('should call the API with the removed policy from the exception tags', async () => { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.tsx index beee26506cd9e..b37fbfe95bd59 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.tsx @@ -6,7 +6,7 @@ */ import { EuiCallOut, EuiConfirmModal, EuiSpacer, EuiText } from '@elastic/eui'; -import { useQueryClient } from 'react-query'; +import { useQueryClient } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import React, { useCallback } from 'react'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.tsx index c13c351f935ac..d4adb3b53b23a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useMemo, useState } from 'react'; -import { useQueryClient } from 'react-query'; +import { useQueryClient } from '@tanstack/react-query'; import { isEmpty, without } from 'lodash/fp'; import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.test.tsx index 2ccfaff3c8b2b..5f9336e291e77 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.test.tsx @@ -67,7 +67,7 @@ describe('Policy details artifacts list', () => { getArtifactPath={getEventFiltersListPath} /> ); - await waitFor(mockedApi.responseProvider.eventFiltersList); + await waitFor(() => expect(mockedApi.responseProvider.eventFiltersList).toHaveBeenCalled()); }); return renderResult; }; @@ -99,7 +99,9 @@ describe('Policy details artifacts list', () => { it('should expand an item when expand is clicked', async () => { await render(); - expect(renderResult.getAllByTestId('artifacts-collapsed-list-card')).toHaveLength(1); + await waitFor(() => { + expect(renderResult.getAllByTestId('artifacts-collapsed-list-card')).toHaveLength(1); + }); userEvent.click( renderResult.getByTestId('artifacts-collapsed-list-card-header-expandCollapse') diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_integration_artifacts_card.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_integration_artifacts_card.test.tsx index 2e662b393c92f..2ac194b39bd8e 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_integration_artifacts_card.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_integration_artifacts_card.test.tsx @@ -69,9 +69,11 @@ describe('Fleet integration policy endpoint security event filters card', () => ); await render(); - expect(renderResult.getByTestId('artifacts-fleet-integration-card')).toHaveTextContent( - 'Event filters3' - ); + await waitFor(() => { + expect(renderResult.getByTestId('artifacts-fleet-integration-card')).toHaveTextContent( + 'Event filters3' + ); + }); }); it('should show the card even when no event filters associated with the policy', async () => { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx index 227e4eb3a78cd..eab38e3cdd7b5 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx @@ -23,7 +23,9 @@ import { APP_UI_ID } from '../../../../../common/constants'; import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { exceptionsFindHttpMocks } from '../../../mocks/exceptions_list_http_mocks'; -jest.mock('./policy_forms/components/policy_form_layout'); +jest.mock('./policy_forms/components/policy_form_layout', () => ({ + PolicyFormLayout: () => <>, +})); jest.mock('../../../../common/components/user_privileges'); jest.mock('../../../../common/hooks/use_experimental_features'); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.test.tsx index 122ef57fa4a3e..75ebfc9ebda54 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.test.tsx @@ -42,7 +42,7 @@ describe('When on the policy list page', () => { describe('and there are no policies', () => { beforeEach(async () => { - getPackagePolicies.mockImplementation(() => + getPackagePolicies.mockResolvedValue( sendGetEndpointSpecificPackagePoliciesMock({ page: 1, perPage: 20, @@ -60,24 +60,24 @@ describe('When on the policy list page', () => { it('should show the empty page', () => { expect(renderResult.getByTestId('emptyPolicyTable')).toBeTruthy(); }); - it('should show instruction text and a button to add the Endpoint Security integration', () => { + it('should show instruction text and a button to add the Endpoint Security integration', async () => { expect( renderResult.findByText( 'From this page, you’ll be able to view and manage the Endpoint and Cloud Security Integration policies in your environment running Endpoint and Cloud Security.' ) ).toBeTruthy(); - expect(renderResult.getByTestId('onboardingStartButton')).toBeTruthy(); + await waitFor(() => { + expect(renderResult.getByTestId('onboardingStartButton')).toBeTruthy(); + }); }); }); describe('and data exists', () => { - let policies: GetPolicyListResponse; + const policies: GetPolicyListResponse = sendGetEndpointSpecificPackagePoliciesMock(); + beforeEach(async () => { - policies = await sendGetEndpointSpecificPackagePoliciesMock(); - getPackagePolicies.mockImplementation(async () => { - return policies; - }); - getAgentPolicies.mockResolvedValue({ + getPackagePolicies.mockReturnValue(policies); + getAgentPolicies.mockReturnValue({ items: [ { package_policies: [policies.items[0].id], agents: 4 }, { package_policies: [policies.items[1].id], agents: 2 }, @@ -118,7 +118,7 @@ describe('When on the policy list page', () => { expect(updatedByCells[0].textContent).toEqual(expectedAvatarName.charAt(0)); expect(firstUpdatedByName.textContent).toEqual(expectedAvatarName); }); - it('should show the correct endpoint count', () => { + it('should show the correct endpoint count', async () => { const endpointCount = renderResult.getAllByTestId('policyEndpointCountLink'); expect(endpointCount[0].textContent).toBe('4'); }); @@ -151,24 +151,28 @@ describe('When on the policy list page', () => { }); describe('pagination', () => { beforeEach(async () => { - getPackagePolicies.mockImplementation(async ({ page, perPage }) => { + getPackagePolicies.mockImplementation(({ page, perPage }) => { // # policies = 100 to trigger UI to show pagination - const response = await sendGetEndpointSpecificPackagePoliciesMock({ + return sendGetEndpointSpecificPackagePoliciesMock({ page, perPage, count: 100, }); - return response; }); render(); await waitFor(() => { expect(getPackagePolicies).toHaveBeenCalled(); + expect(sendGetEndpointSpecificPackagePolicies).toHaveBeenCalled(); + expect(sendGetAgentPolicyList).toHaveBeenCalled(); }); }); afterEach(() => { getPackagePolicies.mockReset(); }); it('should pass the correct page value to the api', async () => { + await waitFor(() => { + expect(renderResult.getByTestId('pagination-button-next')).toBeTruthy(); + }); act(() => { renderResult.getByTestId('pagination-button-next').click(); }); @@ -181,6 +185,9 @@ describe('When on the policy list page', () => { }); }); it('should pass the correct pageSize value to the api', async () => { + await waitFor(() => { + expect(renderResult.getByTestId('tablePaginationPopoverButton')).toBeTruthy(); + }); act(() => { renderResult.getByTestId('tablePaginationPopoverButton').click(); }); @@ -203,10 +210,10 @@ describe('When on the policy list page', () => { }); await waitFor(() => { expect(getPackagePolicies).toHaveBeenCalledTimes(2); - }); - expect(getPackagePolicies.mock.calls[1][1].query).toEqual({ - page: 3, - perPage: 50, + expect(getPackagePolicies.mock.calls[1][1].query).toEqual({ + page: 3, + perPage: 50, + }); }); }); it('should reset page back to 1 if the user is on a page > 1 and they change page size', async () => { @@ -215,24 +222,23 @@ describe('When on the policy list page', () => { history.push('/administration/policies?page=2&pageSize=20'); }); await waitFor(() => { - expect(getPackagePolicies).toHaveBeenCalledTimes(2); + expect(getPackagePolicies).toHaveBeenCalled(); }); // change pageSize - act(() => { - renderResult.getByTestId('tablePaginationPopoverButton').click(); + await act(async () => { + (await renderResult.getByTestId('tablePaginationPopoverButton')).click(); }); const pageSize10 = await renderResult.findByTestId('tablePagination-10-rows'); act(() => { pageSize10.click(); }); - await waitFor(() => { - expect(getPackagePolicies).toHaveBeenCalledTimes(3); - }); - expect(getPackagePolicies.mock.calls[2][1].query).toEqual({ - page: 1, - perPage: 10, + expect(sendGetEndpointSpecificPackagePolicies).toHaveBeenLastCalledWith(expect.any(Object), { + query: { + page: 1, + perPage: 10, + }, }); }); it('should set page to 1 if user tries to force an invalid page number', async () => { diff --git a/x-pack/plugins/security_solution/public/management/services/policies/hooks.test.ts b/x-pack/plugins/security_solution/public/management/services/policies/hooks.test.ts index b591051d72c94..8bd8c4c72efea 100644 --- a/x-pack/plugins/security_solution/public/management/services/policies/hooks.test.ts +++ b/x-pack/plugins/security_solution/public/management/services/policies/hooks.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { UseQueryOptions } from 'react-query'; +import type { UseQueryOptions } from '@tanstack/react-query'; import type { IHttpFetchError, HttpSetup } from '@kbn/core-http-browser'; import type { GetPackagesResponse } from '@kbn/fleet-plugin/common'; import { useGetEndpointSecurityPackage } from './hooks'; diff --git a/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts b/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts index 6b2c726875827..fef45b657d5da 100644 --- a/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts +++ b/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { QueryObserverResult, UseQueryOptions } from 'react-query'; -import { useQuery } from 'react-query'; +import type { QueryObserverResult, UseQueryOptions } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { GetAgentPoliciesResponse, GetPackagesResponse } from '@kbn/fleet-plugin/common'; import { AGENT_POLICY_SAVED_OBJECT_TYPE } from '@kbn/fleet-plugin/common'; diff --git a/x-pack/plugins/security_solution/public/management/services/policies/test_mock_utils.ts b/x-pack/plugins/security_solution/public/management/services/policies/test_mock_utils.ts index b415fceedc0cd..af7a531d5a352 100644 --- a/x-pack/plugins/security_solution/public/management/services/policies/test_mock_utils.ts +++ b/x-pack/plugins/security_solution/public/management/services/policies/test_mock_utils.ts @@ -7,13 +7,13 @@ import { FleetPackagePolicyGenerator } from '../../../../common/endpoint/data_generators/fleet_package_policy_generator'; import type { GetPolicyListResponse } from '../../pages/policy/types'; -export const sendGetEndpointSpecificPackagePoliciesMock = async ( +export const sendGetEndpointSpecificPackagePoliciesMock = ( params: { page: number; perPage: number; count: number; } = { page: 1, perPage: 20, count: 5 } -): Promise => { +): GetPolicyListResponse => { const { page, perPage, count } = params; const generator = new FleetPackagePolicyGenerator(); const items = Array.from({ length: count }, (_, index) => { diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx index a7e2f67e5f586..53c69b5b47afd 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx @@ -8,7 +8,7 @@ import { EuiAccordion, EuiLink, EuiText } from '@elastic/eui'; import deepEqual from 'fast-deep-equal'; import React, { useCallback, useEffect, useState, useMemo } from 'react'; -import { createPortalNode, InPortal } from 'react-reverse-portal'; +import { createHtmlPortalNode, InPortal } from 'react-reverse-portal'; import styled, { css } from 'styled-components'; import type { Filter, Query } from '@kbn/es-query'; @@ -127,7 +127,7 @@ export const EmbeddedMapComponent = ({ // own component tree instead of the embeddables (default). This is necessary to have access to // the Redux store, theme provider, etc, which is required to register and un-register the draggable // Search InPortal/OutPortal for implementation touch points - const portalNode = React.useMemo(() => createPortalNode(), []); + const portalNode = React.useMemo(() => createHtmlPortalNode(), []); useEffect(() => { setMapIndexPatterns((prevMapIndexPatterns) => { diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.test.tsx b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.test.tsx index b7e27b2422451..c82051b11769c 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.test.tsx +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.test.tsx @@ -7,7 +7,7 @@ import { embeddablePluginMock } from '@kbn/embeddable-plugin/public/mocks'; import { createEmbeddable, findMatchingIndexPatterns } from './embedded_map_helpers'; -import { createPortalNode } from 'react-reverse-portal'; +import { createHtmlPortalNode } from 'react-reverse-portal'; import { mockAPMIndexPattern, mockAPMRegexIndexPattern, @@ -43,7 +43,7 @@ describe('embedded_map_helpers', () => { '2020-07-07T08:20:18.966Z', '2020-07-08T08:20:18.966Z', setQueryMock, - createPortalNode(), + createHtmlPortalNode(), mockEmbeddable ); expect(setQueryMock).toHaveBeenCalledTimes(1); @@ -58,7 +58,7 @@ describe('embedded_map_helpers', () => { '2020-07-07T08:20:18.966Z', '2020-07-08T08:20:18.966Z', setQueryMock, - createPortalNode(), + createHtmlPortalNode(), mockEmbeddable ); expect(setQueryMock.mock.calls[0][0].refetch).not.toBe(embeddable.reload); diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx index 731adaa9b5081..3583e54f4c980 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx @@ -7,7 +7,7 @@ import uuid from 'uuid'; import React from 'react'; -import type { PortalNode } from 'react-reverse-portal'; +import type { HtmlPortalNode } from 'react-reverse-portal'; import { OutPortal } from 'react-reverse-portal'; import minimatch from 'minimatch'; import type { Filter, Query } from '@kbn/es-query'; @@ -51,7 +51,7 @@ export const createEmbeddable = async ( startDate: GlobalTimeArgs['from'], endDate: GlobalTimeArgs['to'], setQuery: GlobalTimeArgs['setQuery'], - portalNode: PortalNode, + portalNode: HtmlPortalNode, embeddableApi: EmbeddableStart ): Promise => { const factory = embeddableApi.getEmbeddableFactory< diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.test.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.test.tsx index eff9948617b67..cee2884d1bdf1 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.test.tsx @@ -62,95 +62,81 @@ describe('useCasesByStatus', () => { beforeEach(() => { jest.clearAllMocks(); }); - test('init', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseCasesByStatusProps, - UseCasesByStatusResults - >(() => useCasesByStatus({ skip: false }), { + test('init', () => { + const { result } = renderHook( + () => useCasesByStatus({}), + { wrapper: TestProviders, - }); - await waitForNextUpdate(); - expect(result.current).toEqual({ - closed: 0, - inProgress: 0, - isLoading: true, - open: 0, - totalCounts: 0, - updatedAt: dateNow, - }); + } + ); + expect(result.current).toEqual({ + closed: 0, + inProgress: 0, + isLoading: true, + open: 0, + totalCounts: 0, + updatedAt: dateNow, }); }); test('fetch data', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseCasesByStatusProps, - UseCasesByStatusResults - >(() => useCasesByStatus({ skip: false }), { - wrapper: TestProviders, - }); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(result.current).toEqual({ - closed: 3, - inProgress: 2, - isLoading: false, - open: 1, - totalCounts: 6, - updatedAt: dateNow, - }); + const { result, waitForNextUpdate } = renderHook< + UseCasesByStatusProps, + UseCasesByStatusResults + >(() => useCasesByStatus({ skip: false }), { + wrapper: TestProviders, + }); + await waitForNextUpdate(); + expect(result.current).toEqual({ + closed: 3, + inProgress: 2, + isLoading: false, + open: 1, + totalCounts: 6, + updatedAt: dateNow, }); }); test('it should call setQuery when fetching', async () => { - await act(async () => { - const { waitForNextUpdate } = renderHook( - () => useCasesByStatus({ skip: false }), - { - wrapper: TestProviders, - } - ); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(mockSetQuery).toHaveBeenCalled(); - }); + const { waitForNextUpdate } = renderHook( + () => useCasesByStatus({ skip: false }), + { + wrapper: TestProviders, + } + ); + await waitForNextUpdate(); + expect(mockSetQuery).toHaveBeenCalled(); }); test('it should call deleteQuery when unmounting', async () => { - await act(async () => { - const { waitForNextUpdate, unmount } = renderHook< - UseCasesByStatusProps, - UseCasesByStatusResults - >(() => useCasesByStatus({ skip: false }), { - wrapper: TestProviders, - }); - await waitForNextUpdate(); + const { waitForNextUpdate, unmount } = renderHook< + UseCasesByStatusProps, + UseCasesByStatusResults + >(() => useCasesByStatus({ skip: false }), { + wrapper: TestProviders, + }); + await waitForNextUpdate(); - unmount(); + unmount(); - expect(mockDeleteQuery).toHaveBeenCalled(); - }); + expect(mockDeleteQuery).toHaveBeenCalled(); }); test('skip', async () => { const abortSpy = jest.spyOn(AbortController.prototype, 'abort'); - await act(async () => { - const localProps = { skip: false }; + const localProps = { skip: false }; - const { rerender, waitForNextUpdate } = renderHook< - UseCasesByStatusProps, - UseCasesByStatusResults - >(() => useCasesByStatus(localProps), { - wrapper: TestProviders, - }); - await waitForNextUpdate(); - await waitForNextUpdate(); - - localProps.skip = true; - act(() => rerender()); - act(() => rerender()); - expect(abortSpy).toHaveBeenCalledTimes(2); + const { rerender, waitForNextUpdate } = renderHook< + UseCasesByStatusProps, + UseCasesByStatusResults + >(() => useCasesByStatus(localProps), { + wrapper: TestProviders, }); + await waitForNextUpdate(); + + localProps.skip = true; + act(() => rerender()); + act(() => rerender()); + expect(abortSpy).toHaveBeenCalledTimes(2); }); }); diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/cases_table.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/cases_table.tsx index 122bfa6fdd07c..e5fdeb6c31638 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/cases_table.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/cases_table.tsx @@ -101,12 +101,13 @@ const getTableColumns: GetTableColumns = () => [ { field: 'id', name: i18n.CASES_TABLE_COLUMN_NAME, - truncateText: true, - textOnly: true, 'data-test-subj': 'recentlyCreatedCaseName', - render: (id: string, { name }) => ( - + {name} ), diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.test.ts b/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.test.ts index 1e9b742f70600..036ed835b46cf 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.test.ts +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.test.ts @@ -63,17 +63,14 @@ describe('useCaseItems', () => { }); it('should return default values', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderUseCaseItems(); + const { result, waitForNextUpdate } = renderUseCaseItems(); - await waitForNextUpdate(); - await waitForNextUpdate(); + await waitForNextUpdate(); - expect(result.current).toEqual({ - items: [], - isLoading: false, - updatedAt: dateNow, - }); + expect(result.current).toEqual({ + items: [], + isLoading: false, + updatedAt: dateNow, }); expect(mockCasesApi).toBeCalledWith({ @@ -89,44 +86,36 @@ describe('useCaseItems', () => { it('should return parsed items', async () => { mockCasesApi.mockReturnValue(mockCasesResult); + const { result, waitForNextUpdate } = renderUseCaseItems(); - await act(async () => { - const { result, waitForNextUpdate } = renderUseCaseItems(); + await waitForNextUpdate(); - await waitForNextUpdate(); - await waitForNextUpdate(); - - expect(result.current).toEqual({ - items: parsedCasesItems, - isLoading: false, - updatedAt: dateNow, - }); + expect(result.current).toEqual({ + items: parsedCasesItems, + isLoading: false, + updatedAt: dateNow, }); }); test('it should call setQuery when fetching', async () => { mockCasesApi.mockReturnValue(mockCasesResult); - await act(async () => { - const { waitForNextUpdate } = renderUseCaseItems(); + const { waitForNextUpdate } = renderUseCaseItems(); - await waitForNextUpdate(); - await waitForNextUpdate(); + await waitForNextUpdate(); - expect(mockSetQuery).toHaveBeenCalled(); - }); + expect(mockSetQuery).toHaveBeenCalled(); }); test('it should call deleteQuery when unmounting', async () => { - await act(async () => { - const { waitForNextUpdate, unmount } = renderUseCaseItems(); + const { waitForNextUpdate, unmount } = renderUseCaseItems(); - await waitForNextUpdate(); - await waitForNextUpdate(); + await waitForNextUpdate(); + act(() => { unmount(); - - expect(mockDeleteQuery).toHaveBeenCalled(); }); + + expect(mockDeleteQuery).toHaveBeenCalled(); }); it('should return new updatedAt', async () => { @@ -135,18 +124,15 @@ describe('useCaseItems', () => { mockDateNow.mockReturnValueOnce(dateNow); mockCasesApi.mockReturnValue(mockCasesResult); - await act(async () => { - const { result, waitForNextUpdate } = renderUseCaseItems(); + const { result, waitForNextUpdate } = renderUseCaseItems(); - await waitForNextUpdate(); - await waitForNextUpdate(); + await waitForNextUpdate(); - expect(mockDateNow).toHaveBeenCalled(); - expect(result.current).toEqual({ - items: parsedCasesItems, - isLoading: false, - updatedAt: newDateNow, - }); + expect(mockDateNow).toHaveBeenCalled(); + expect(result.current).toEqual({ + items: parsedCasesItems, + isLoading: false, + updatedAt: newDateNow, }); }); diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx index a2373b0734ece..3ae0d5e1384c3 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx @@ -101,11 +101,13 @@ const getTableColumns: GetTableColumns = (handleClick) => [ { field: 'hostName', name: i18n.HOST_ALERTS_HOSTNAME_COLUMN, - truncateText: true, - textOnly: true, 'data-test-subj': 'hostSeverityAlertsTable-hostName', render: (hostName: string) => ( - + ), diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx index 0eed36ff14102..3e9e79a39de58 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx @@ -59,6 +59,7 @@ export const getTableColumns: GetTableColumns = ({ getAppUrl, navigateTo, openRu data-test-subj={`${id}-tooltip`} title={i18n.OPEN_RULE_DETAIL_TOOLTIP} content={name} + anchorClassName="eui-textTruncate" > {/* eslint-disable-next-line @elastic/eui/href-or-on-click */} [ { field: 'userName', name: i18n.USER_ALERTS_USERNAME_COLUMN, - truncateText: true, - textOnly: true, 'data-test-subj': 'userSeverityAlertsTable-userName', render: (userName: string) => ( - + ), diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.tsx index f595b6a62ddbb..4035cc86bfe14 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.tsx @@ -16,7 +16,7 @@ import { devToolPrebuiltContentUrl } from '../../../../common/constants'; import { OpenInDevConsoleButton } from '../../../common/components/open_in_dev_console'; import { useChcekSignalIndex } from '../../../detections/containers/detection_engine/alerts/use_check_signal_index'; import type { LinkPanelListItem } from '../link_panel'; -import { useSpaceId } from '../../../risk_score/containers/common'; +import { useSpaceId } from '../../../common/hooks/use_space_id'; export const RISKY_HOSTS_DOC_LINK = 'https://www.github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md'; diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/all/index.tsx b/x-pack/plugins/security_solution/public/risk_score/containers/all/index.tsx index 50c7a095887c0..cdafc7d63c8b1 100644 --- a/x-pack/plugins/security_solution/public/risk_score/containers/all/index.tsx +++ b/x-pack/plugins/security_solution/public/risk_score/containers/all/index.tsx @@ -34,7 +34,7 @@ import { useAppToasts } from '../../../common/hooks/use_app_toasts'; import { isIndexNotFoundError } from '../../../common/utils/exceptions'; import { useIsExperimentalFeatureEnabled } from '../../../common/hooks/use_experimental_features'; import type { inputsModel } from '../../../common/store'; -import { useSpaceId } from '../common'; +import { useSpaceId } from '../../../common/hooks/use_space_id'; export interface RiskScoreState { data?: RiskScoreType; diff --git a/x-pack/plugins/security_solution/public/risk_score/containers/kpi/index.tsx b/x-pack/plugins/security_solution/public/risk_score/containers/kpi/index.tsx index 685a0c992c9f1..396d86e2d6acc 100644 --- a/x-pack/plugins/security_solution/public/risk_score/containers/kpi/index.tsx +++ b/x-pack/plugins/security_solution/public/risk_score/containers/kpi/index.tsx @@ -30,7 +30,7 @@ import { isIndexNotFoundError } from '../../../common/utils/exceptions'; import type { ESTermQuery } from '../../../../common/typed_json'; import { useIsExperimentalFeatureEnabled } from '../../../common/hooks/use_experimental_features'; import type { SeverityCount } from '../../../common/components/severity/types'; -import { useSpaceId } from '../common'; +import { useSpaceId } from '../../../common/hooks/use_space_id'; type GetHostsRiskScoreProps = KpiRiskScoreRequestOptions & { data: DataPublicPluginStart; diff --git a/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx b/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx index a6189921665eb..167f2c8d67476 100644 --- a/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx +++ b/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx @@ -8,8 +8,9 @@ import React, { memo } from 'react'; import { Redirect } from 'react-router-dom'; import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; -import type { ThreatIntelligenceSecuritySolutionContext } from '@kbn/threat-intelligence-plugin/public'; +import type { SecuritySolutionPluginContext } from '@kbn/threat-intelligence-plugin/public'; import { THREAT_INTELLIGENCE_BASE_PATH } from '@kbn/threat-intelligence-plugin/public'; +import type { SourcererDataView } from '@kbn/threat-intelligence-plugin/public/types'; import { useKibana } from '../common/lib/kibana'; import { FiltersGlobal } from '../common/components/filters_global'; import { SpyRoute } from '../common/utils/route/spy_routes'; @@ -18,19 +19,23 @@ import { useIsExperimentalFeatureEnabled } from '../common/hooks/use_experimenta import { licenseService } from '../common/hooks/use_license'; import { SecurityPageName } from '../app/types'; import type { SecuritySubPluginRoutes } from '../app/types'; +import { useSourcererDataView } from '../common/containers/sourcerer'; const ThreatIntelligence = memo(() => { const { threatIntelligence } = useKibana().services; const ThreatIntelligencePlugin = threatIntelligence.getComponent(); + const sourcererDataView = useSourcererDataView(); + const enabled = useIsExperimentalFeatureEnabled('threatIntelligenceEnabled'); if (!enabled) { return ; } - const securitySolutionContext: ThreatIntelligenceSecuritySolutionContext = { + const securitySolutionContext: SecuritySolutionPluginContext = { getFiltersGlobalComponent: () => FiltersGlobal, licenseService, + sourcererDataView: sourcererDataView as unknown as SourcererDataView, }; return ( diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts index 8c69ae2df30da..0d560b600ae34 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import { getOr, isEmpty } from 'lodash/fp'; import type { Action } from 'typescript-fsa'; import uuid from 'uuid'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/helpers.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/helpers.tsx index 32af7f9920a34..b34338b4cbce9 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/helpers.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/helpers.tsx @@ -9,6 +9,7 @@ import { some } from 'lodash/fp'; import { useMemo } from 'react'; import type { TimelineEventsDetailsItem } from '../../../../../common/search_strategy'; import { getFieldValue } from '../../../../detections/components/host_isolation/helpers'; +import { DEFAULT_ALERTS_INDEX, DEFAULT_PREVIEW_INDEX } from '../../../../../common/constants'; interface GetBasicDataFromDetailsData { alertId: string; @@ -51,3 +52,20 @@ export const useBasicDataFromDetailsData = ( [alertId, hostName, isAlert, ruleName, timestamp] ); }; + +/* +The referenced alert _index in the flyout uses the `.internal.` such as +`.internal.alerts-security.alerts-spaceId` in the alert page flyout and +.internal.preview.alerts-security.alerts-spaceId` in the rule creation preview flyout +but we always want to use their respective aliase indices rather than accessing their backing .internal. indices. +*/ +export const getAlertIndexAlias = ( + index: string, + spaceId: string = 'default' +): string | undefined => { + if (index.startsWith(`.internal${DEFAULT_ALERTS_INDEX}`)) { + return `${DEFAULT_ALERTS_INDEX}-${spaceId}`; + } else if (index.startsWith(`.internal${DEFAULT_PREVIEW_INDEX}`)) { + return `${DEFAULT_PREVIEW_INDEX}-${spaceId}`; + } +}; diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.test.tsx index 2e69985258247..c9b1d42b535ec 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.test.tsx @@ -11,8 +11,6 @@ import '../../../../common/mock/match_media'; import { TestProviders } from '../../../../common/mock'; import { TimelineId, TimelineTabs } from '../../../../../common/types/timeline'; import type { Ecs } from '../../../../../common/ecs'; -import { mockAlertDetailsData } from '../../../../common/components/event_details/__mocks__'; -import type { TimelineEventsDetailsItem } from '../../../../../common/search_strategy'; import { KibanaServices, useKibana, @@ -21,7 +19,9 @@ import { import { mockBrowserFields, mockRuntimeMappings } from '../../../../common/containers/source/mock'; import { coreMock } from '@kbn/core/public/mocks'; import { mockCasesContext } from '@kbn/cases-plugin/public/mocks/mock_cases_context'; +import { useTimelineEventsDetails } from '../../../containers/details'; import { allCasesPermissions } from '../../../../cases_test_utils'; +import { DEFAULT_ALERTS_INDEX, DEFAULT_PREVIEW_INDEX } from '../../../../../common/constants'; const ecsData: Ecs = { _id: '1', @@ -37,19 +37,16 @@ const ecsData: Ecs = { }, }; -const mockAlertDetailsDataWithIsObject = mockAlertDetailsData.map((detail) => { - return { - ...detail, - isObjectArray: false, - }; -}) as TimelineEventsDetailsItem[]; - jest.mock('../../../../../common/endpoint/service/host_isolation/utils', () => { return { isIsolationSupported: jest.fn().mockReturnValue(true), }; }); +jest.mock('../../../../common/hooks/use_space_id', () => ({ + useSpaceId: jest.fn().mockReturnValue('testSpace'), +})); + jest.mock( '../../../../detections/containers/detection_engine/alerts/use_host_isolation_status', () => { @@ -101,18 +98,23 @@ const mockSearchStrategy = jest.fn(); const defaultProps = { timelineId: TimelineId.test, - loadingEventDetails: false, - detailsEcsData: ecsData, isHostIsolationPanelOpen: false, handleOnEventClosed: jest.fn(), onAddIsolationStatusClick: jest.fn(), expandedEvent: { eventId: ecsData._id, indexName: '' }, - detailsData: mockAlertDetailsDataWithIsObject, tabType: TimelineTabs.query, browserFields: mockBrowserFields, runtimeMappings: mockRuntimeMappings, }; +jest.mock('../../../containers/details', () => { + const actual = jest.requireActual('../../../containers/details'); + return { + ...actual, + useTimelineEventsDetails: jest.fn().mockImplementation(() => []), + }; +}); + describe('event details footer component', () => { beforeEach(() => { const coreStartMock = coreMock.createStart(); @@ -169,4 +171,76 @@ describe('event details footer component', () => { const element = wrapper.queryByTestId('side-panel-flyout-footer'); expect(element).toBeNull(); }); + + describe('Alerts', () => { + const propsWithAlertIndex = { + ...defaultProps, + expandedEvent: { + eventId: ecsData._id, + indexName: `.internal${DEFAULT_ALERTS_INDEX}-testSpace`, + }, + }; + test('it uses the alias alerts index', () => { + render( + + + + ); + expect(useTimelineEventsDetails).toHaveBeenCalledWith({ + entityType: 'events', + indexName: `${DEFAULT_ALERTS_INDEX}-testSpace`, + eventId: propsWithAlertIndex.expandedEvent.eventId ?? '', + runtimeMappings: mockRuntimeMappings, + skip: false, + }); + }); + + test('it uses the alias alerts preview index', () => { + const alertPreviewProps = { + ...propsWithAlertIndex, + expandedEvent: { + ...propsWithAlertIndex.expandedEvent, + indexName: `.internal${DEFAULT_PREVIEW_INDEX}-testSpace`, + }, + }; + render( + + + + ); + + expect(useTimelineEventsDetails).toHaveBeenCalledWith({ + entityType: 'events', + indexName: `${DEFAULT_PREVIEW_INDEX}-testSpace`, + eventId: propsWithAlertIndex.expandedEvent.eventId, + runtimeMappings: mockRuntimeMappings, + skip: false, + }); + }); + + test(`it does NOT use the alerts alias when regular events happen to include a trailing '${DEFAULT_ALERTS_INDEX}' in the index name`, () => { + const indexName = `.ds-logs-endpoint.alerts-default-2022.08.09-000001${DEFAULT_ALERTS_INDEX}`; // a regular event, that happens to include a trailing `.alerts-security.alerts` + const propsWithEventIndex = { + ...defaultProps, + expandedEvent: { + eventId: ecsData._id, + indexName, + }, + }; + + render( + + + + ); + + expect(useTimelineEventsDetails).toHaveBeenCalledWith({ + entityType: 'events', + indexName, // <-- use the original index name, not the alerts alias + eventId: propsWithEventIndex.expandedEvent.eventId, + runtimeMappings: mockRuntimeMappings, + skip: false, + }); + }); + }); }); 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 8859b6f20ab33..2c0247a4d61da 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 @@ -20,7 +20,8 @@ import type { HostRisk } from '../../../../risk_score/containers'; import { useHostRiskScore } from '../../../../risk_score/containers'; import { useHostIsolationTools } from './use_host_isolation_tools'; import { FlyoutBody, FlyoutHeader, FlyoutFooter } from './flyout'; -import { useBasicDataFromDetailsData } from './helpers'; +import { useBasicDataFromDetailsData, getAlertIndexAlias } from './helpers'; +import { useSpaceId } from '../../../../common/hooks/use_space_id'; interface EventDetailsPanelProps { browserFields: BrowserFields; @@ -51,10 +52,13 @@ const EventDetailsPanelComponent: React.FC = ({ timelineId, isReadOnly, }) => { + const currentSpaceId = useSpaceId(); + const { indexName } = expandedEvent; + const eventIndex = getAlertIndexAlias(indexName, currentSpaceId) ?? indexName; const [loading, detailsData, rawEventData, ecsData, refetchFlyoutData] = useTimelineEventsDetails( { entityType, - indexName: expandedEvent.indexName ?? '', + indexName: eventIndex ?? '', eventId: expandedEvent.eventId ?? '', runtimeMappings, skip: !expandedEvent.eventId, diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/index.test.tsx index d8c7c5e34c908..292dd5e1a44b9 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/index.test.tsx @@ -38,7 +38,9 @@ jest.mock('../../containers', () => ({ useTimelineEvents: jest.fn(), })); -jest.mock('./tabs_content'); +jest.mock('./tabs_content', () => ({ + TabsContent: () =>
, +})); jest.mock('../../../common/lib/kibana'); const originalKibanaLib = jest.requireActual('../../../common/lib/kibana'); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx index 76d3ceb240883..b7f9d74a9019c 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx @@ -40,7 +40,7 @@ jest.mock('../../../../common/lib/kibana', () => ({ })); describe('NewTimeline', () => { - const mockGetButton = jest.fn(); + const mockGetButton = jest.fn().mockReturnValue('<>'); const props: NewTimelineProps = { closeGearMenu: jest.fn(), diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts index 6eb04c9833e27..906b1e3168a70 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts @@ -248,30 +248,6 @@ describe('test endpoint routes', () => { must: [ { bool: { - filter: [ - { - terms: { - 'united.agent.policy_id': [], - }, - }, - { - exists: { - field: 'united.endpoint.agent.id', - }, - }, - { - exists: { - field: 'united.agent.agent.id', - }, - }, - { - term: { - 'united.agent.active': { - value: true, - }, - }, - }, - ], must_not: { terms: { 'agent.id': [ @@ -280,6 +256,12 @@ describe('test endpoint routes', () => { ], }, }, + filter: [ + { terms: { 'united.agent.policy_id': [] } }, + { exists: { field: 'united.endpoint.agent.id' } }, + { exists: { field: 'united.agent.agent.id' } }, + { term: { 'united.agent.active': { value: true } } }, + ], }, }, { @@ -290,13 +272,7 @@ describe('test endpoint routes', () => { filter: [ { bool: { - should: [ - { - exists: { - field: 'united.agent.upgrade_started_at', - }, - }, - ], + should: [{ exists: { field: 'united.agent.upgrade_started_at' } }], minimum_should_match: 1, }, }, @@ -304,13 +280,7 @@ describe('test endpoint routes', () => { bool: { must_not: { bool: { - should: [ - { - exists: { - field: 'united.agent.upgraded_at', - }, - }, - ], + should: [{ exists: { field: 'united.agent.upgraded_at' } }], minimum_should_match: 1, }, }, @@ -323,13 +293,7 @@ describe('test endpoint routes', () => { bool: { must_not: { bool: { - should: [ - { - exists: { - field: 'united.agent.last_checkin', - }, - }, - ], + should: [{ exists: { field: 'united.agent.last_checkin' } }], minimum_should_match: 1, }, }, @@ -337,16 +301,20 @@ describe('test endpoint routes', () => { }, { bool: { - should: [ - { - exists: { - field: 'united.agent.unenrollment_started_at', - }, - }, - ], + should: [{ exists: { field: 'united.agent.unenrollment_started_at' } }], minimum_should_match: 1, }, }, + { + bool: { + must_not: { + bool: { + should: [{ exists: { field: 'united.agent.policy_revision_idx' } }], + minimum_should_match: 1, + }, + }, + }, + }, ], minimum_should_match: 1, }, @@ -355,13 +323,7 @@ describe('test endpoint routes', () => { bool: { must_not: { bool: { - should: [ - { - match: { - 'host.ip': '10.140.73.246', - }, - }, - ], + should: [{ match: { 'host.ip': '10.140.73.246' } }], minimum_should_match: 1, }, }, diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.fixtures.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.fixtures.ts index 31b383f2a033e..30189459ff167 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.fixtures.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.fixtures.ts @@ -18,28 +18,10 @@ export const expectedCompleteUnitedIndexQuery = { }, }, filter: [ - { - terms: { - 'united.agent.policy_id': ['test-endpoint-policy-id'], - }, - }, - { - exists: { - field: 'united.endpoint.agent.id', - }, - }, - { - exists: { - field: 'united.agent.agent.id', - }, - }, - { - term: { - 'united.agent.active': { - value: true, - }, - }, - }, + { terms: { 'united.agent.policy_id': ['test-endpoint-policy-id'] } }, + { exists: { field: 'united.endpoint.agent.id' } }, + { exists: { field: 'united.agent.agent.id' } }, + { term: { 'united.agent.active': { value: true } } }, ], }, }, @@ -53,15 +35,7 @@ export const expectedCompleteUnitedIndexQuery = { filter: [ { bool: { - should: [ - { - range: { - 'united.agent.last_checkin': { - lt: 'now-300s', - }, - }, - }, - ], + should: [{ range: { 'united.agent.last_checkin': { lt: 'now-300s' } } }], minimum_should_match: 1, }, }, @@ -168,6 +142,22 @@ export const expectedCompleteUnitedIndexQuery = { minimum_should_match: 1, }, }, + { + bool: { + must_not: { + bool: { + should: [ + { + exists: { + field: 'united.agent.policy_revision_idx', + }, + }, + ], + minimum_should_match: 1, + }, + }, + }, + }, ], minimum_should_match: 1, }, @@ -191,9 +181,7 @@ export const expectedCompleteUnitedIndexQuery = { bool: { should: [ { - exists: { - field: 'united.agent.upgrade_started_at', - }, + exists: { field: 'united.agent.upgrade_started_at' }, }, ], minimum_should_match: 1, @@ -204,11 +192,7 @@ export const expectedCompleteUnitedIndexQuery = { must_not: { bool: { should: [ - { - exists: { - field: 'united.agent.upgraded_at', - }, - }, + { exists: { field: 'united.agent.upgraded_at' } }, ], minimum_should_match: 1, }, @@ -223,11 +207,7 @@ export const expectedCompleteUnitedIndexQuery = { must_not: { bool: { should: [ - { - exists: { - field: 'united.agent.last_checkin', - }, - }, + { exists: { field: 'united.agent.last_checkin' } }, ], minimum_should_match: 1, }, @@ -237,15 +217,23 @@ export const expectedCompleteUnitedIndexQuery = { { bool: { should: [ - { - exists: { - field: 'united.agent.unenrollment_started_at', - }, - }, + { exists: { field: 'united.agent.unenrollment_started_at' } }, ], minimum_should_match: 1, }, }, + { + bool: { + must_not: { + bool: { + should: [ + { exists: { field: 'united.agent.policy_revision_idx' } }, + ], + minimum_should_match: 1, + }, + }, + }, + }, ], minimum_should_match: 1, }, @@ -268,11 +256,7 @@ export const expectedCompleteUnitedIndexQuery = { { bool: { should: [ - { - match: { - 'united.agent.last_checkin_status': 'error', - }, - }, + { match: { 'united.agent.last_checkin_status': 'error' } }, ], minimum_should_match: 1, }, @@ -280,11 +264,7 @@ export const expectedCompleteUnitedIndexQuery = { { bool: { should: [ - { - match: { - 'united.agent.last_checkin_status': 'degraded', - }, - }, + { match: { 'united.agent.last_checkin_status': 'degraded' } }, ], minimum_should_match: 1, }, @@ -305,9 +285,7 @@ export const expectedCompleteUnitedIndexQuery = { bool: { should: [ { - exists: { - field: 'united.agent.upgrade_started_at', - }, + exists: { field: 'united.agent.upgrade_started_at' }, }, ], minimum_should_match: 1, @@ -318,11 +296,7 @@ export const expectedCompleteUnitedIndexQuery = { must_not: { bool: { should: [ - { - exists: { - field: 'united.agent.upgraded_at', - }, - }, + { exists: { field: 'united.agent.upgraded_at' } }, ], minimum_should_match: 1, }, @@ -337,11 +311,7 @@ export const expectedCompleteUnitedIndexQuery = { must_not: { bool: { should: [ - { - exists: { - field: 'united.agent.last_checkin', - }, - }, + { exists: { field: 'united.agent.last_checkin' } }, ], minimum_should_match: 1, }, @@ -351,15 +321,23 @@ export const expectedCompleteUnitedIndexQuery = { { bool: { should: [ - { - exists: { - field: 'united.agent.unenrollment_started_at', - }, - }, + { exists: { field: 'united.agent.unenrollment_started_at' } }, ], minimum_should_match: 1, }, }, + { + bool: { + must_not: { + bool: { + should: [ + { exists: { field: 'united.agent.policy_revision_idx' } }, + ], + minimum_should_match: 1, + }, + }, + }, + }, ], minimum_should_match: 1, }, @@ -381,13 +359,7 @@ export const expectedCompleteUnitedIndexQuery = { filter: [ { bool: { - should: [ - { - exists: { - field: 'united.agent.upgrade_started_at', - }, - }, - ], + should: [{ exists: { field: 'united.agent.upgrade_started_at' } }], minimum_should_match: 1, }, }, @@ -395,13 +367,7 @@ export const expectedCompleteUnitedIndexQuery = { bool: { must_not: { bool: { - should: [ - { - exists: { - field: 'united.agent.upgraded_at', - }, - }, - ], + should: [{ exists: { field: 'united.agent.upgraded_at' } }], minimum_should_match: 1, }, }, @@ -414,13 +380,7 @@ export const expectedCompleteUnitedIndexQuery = { bool: { must_not: { bool: { - should: [ - { - exists: { - field: 'united.agent.last_checkin', - }, - }, - ], + should: [{ exists: { field: 'united.agent.last_checkin' } }], minimum_should_match: 1, }, }, @@ -428,16 +388,20 @@ export const expectedCompleteUnitedIndexQuery = { }, { bool: { - should: [ - { - exists: { - field: 'united.agent.unenrollment_started_at', - }, - }, - ], + should: [{ exists: { field: 'united.agent.unenrollment_started_at' } }], minimum_should_match: 1, }, }, + { + bool: { + must_not: { + bool: { + should: [{ exists: { field: 'united.agent.policy_revision_idx' } }], + minimum_should_match: 1, + }, + }, + }, + }, ], minimum_should_match: 1, }, @@ -449,13 +413,7 @@ export const expectedCompleteUnitedIndexQuery = { }, { bool: { - should: [ - { - exists: { - field: 'united.endpoint.host.os.name', - }, - }, - ], + should: [{ exists: { field: 'united.endpoint.host.os.name' } }], minimum_should_match: 1, }, }, diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.test.ts index f3c5c6b542de5..7f89444b21fa5 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.test.ts @@ -93,7 +93,7 @@ describe('test filtering endpoint hosts by agent status', () => { const status = ['healthy']; const kuery = buildStatusesKuery(status); const expected = - '(not (united.agent.last_checkin < now-300s AND not ((united.agent.last_checkin_status:error or united.agent.last_checkin_status:degraded) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*))) AND not ( ((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) )) AND not ((united.agent.last_checkin_status:error or united.agent.last_checkin_status:degraded) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*))) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*)))'; + '(not (united.agent.last_checkin < now-300s AND not ((united.agent.last_checkin_status:error or united.agent.last_checkin_status:degraded) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) or (not united.agent.policy_revision_idx:*))) AND not ( ((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) or (not united.agent.policy_revision_idx:*) )) AND not ((united.agent.last_checkin_status:error or united.agent.last_checkin_status:degraded) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) or (not united.agent.policy_revision_idx:*))) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) or (not united.agent.policy_revision_idx:*)))'; expect(kuery).toEqual(expected); }); @@ -101,7 +101,7 @@ describe('test filtering endpoint hosts by agent status', () => { const status = ['offline']; const kuery = buildStatusesKuery(status); const expected = - '(united.agent.last_checkin < now-300s AND not ((united.agent.last_checkin_status:error or united.agent.last_checkin_status:degraded) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*))) AND not ( ((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) ))'; + '(united.agent.last_checkin < now-300s AND not ((united.agent.last_checkin_status:error or united.agent.last_checkin_status:degraded) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) or (not united.agent.policy_revision_idx:*))) AND not ( ((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) or (not united.agent.policy_revision_idx:*) ))'; expect(kuery).toEqual(expected); }); @@ -109,7 +109,7 @@ describe('test filtering endpoint hosts by agent status', () => { const status = ['unhealthy']; const kuery = buildStatusesKuery(status); const expected = - '((united.agent.last_checkin_status:error or united.agent.last_checkin_status:degraded) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*)))'; + '((united.agent.last_checkin_status:error or united.agent.last_checkin_status:degraded) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) or (not united.agent.policy_revision_idx:*)))'; expect(kuery).toEqual(expected); }); @@ -117,7 +117,7 @@ describe('test filtering endpoint hosts by agent status', () => { const status = ['updating']; const kuery = buildStatusesKuery(status); const expected = - '(((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*))'; + '(((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) or (not united.agent.policy_revision_idx:*))'; expect(kuery).toEqual(expected); }); @@ -132,7 +132,7 @@ describe('test filtering endpoint hosts by agent status', () => { const statuses = ['offline', 'unhealthy']; const kuery = buildStatusesKuery(statuses); const expected = - '(united.agent.last_checkin < now-300s AND not ((united.agent.last_checkin_status:error or united.agent.last_checkin_status:degraded) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*))) AND not ( ((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) ) OR (united.agent.last_checkin_status:error or united.agent.last_checkin_status:degraded) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*)))'; + '(united.agent.last_checkin < now-300s AND not ((united.agent.last_checkin_status:error or united.agent.last_checkin_status:degraded) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) or (not united.agent.policy_revision_idx:*))) AND not ( ((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) or (not united.agent.policy_revision_idx:*) ) OR (united.agent.last_checkin_status:error or united.agent.last_checkin_status:degraded) AND not (((united.agent.upgrade_started_at:*) and not (united.agent.upgraded_at:*)) or (not (united.agent.last_checkin:*)) or (united.agent.unenrollment_started_at:*) or (not united.agent.policy_revision_idx:*)))'; expect(kuery).toEqual(expected); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/preview_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/preview_rules_route.ts index e733f36d1421a..9bc72854e0e22 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/preview_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/preview_rules_route.ts @@ -185,6 +185,7 @@ export const previewRulesRoute = async ( | 'getContext' | 'hasContext' >; + hasReachedAlertLimit: () => boolean; done: () => { getRecoveredAlerts: () => [] }; } ) => { @@ -284,7 +285,11 @@ export const previewRulesRoute = async ( queryAlertType.name, previewRuleParams, () => true, - { create: alertInstanceFactoryStub, done: () => ({ getRecoveredAlerts: () => [] }) } + { + create: alertInstanceFactoryStub, + hasReachedAlertLimit: () => false, + done: () => ({ getRecoveredAlerts: () => [] }), + } ); break; case 'saved_query': @@ -297,7 +302,11 @@ export const previewRulesRoute = async ( savedQueryAlertType.name, previewRuleParams, () => true, - { create: alertInstanceFactoryStub, done: () => ({ getRecoveredAlerts: () => [] }) } + { + create: alertInstanceFactoryStub, + hasReachedAlertLimit: () => false, + done: () => ({ getRecoveredAlerts: () => [] }), + } ); break; case 'threshold': @@ -310,7 +319,11 @@ export const previewRulesRoute = async ( thresholdAlertType.name, previewRuleParams, () => true, - { create: alertInstanceFactoryStub, done: () => ({ getRecoveredAlerts: () => [] }) } + { + create: alertInstanceFactoryStub, + hasReachedAlertLimit: () => false, + done: () => ({ getRecoveredAlerts: () => [] }), + } ); break; case 'threat_match': @@ -323,7 +336,11 @@ export const previewRulesRoute = async ( threatMatchAlertType.name, previewRuleParams, () => true, - { create: alertInstanceFactoryStub, done: () => ({ getRecoveredAlerts: () => [] }) } + { + create: alertInstanceFactoryStub, + hasReachedAlertLimit: () => false, + done: () => ({ getRecoveredAlerts: () => [] }), + } ); break; case 'eql': @@ -334,7 +351,11 @@ export const previewRulesRoute = async ( eqlAlertType.name, previewRuleParams, () => true, - { create: alertInstanceFactoryStub, done: () => ({ getRecoveredAlerts: () => [] }) } + { + create: alertInstanceFactoryStub, + hasReachedAlertLimit: () => false, + done: () => ({ getRecoveredAlerts: () => [] }), + } ); break; case 'machine_learning': @@ -345,7 +366,11 @@ export const previewRulesRoute = async ( mlAlertType.name, previewRuleParams, () => true, - { create: alertInstanceFactoryStub, done: () => ({ getRecoveredAlerts: () => [] }) } + { + create: alertInstanceFactoryStub, + hasReachedAlertLimit: () => false, + done: () => ({ getRecoveredAlerts: () => [] }), + } ); break; case 'new_terms': @@ -356,7 +381,11 @@ export const previewRulesRoute = async ( newTermsAlertType.name, previewRuleParams, () => true, - { create: alertInstanceFactoryStub, done: () => ({ getRecoveredAlerts: () => [] }) } + { + create: alertInstanceFactoryStub, + hasReachedAlertLimit: () => false, + done: () => ({ getRecoveredAlerts: () => [] }), + } ); break; default: diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/rule_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/rule_type.ts index f2f023e28da7d..992db3ec1e89a 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/rule_type.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/rule_type.ts @@ -76,6 +76,7 @@ export const createRuleTypeMocks = ( scopedClusterClient: elasticsearchServiceMock.createScopedClusterClient(), alertFactory: { create: jest.fn(() => ({ scheduleActions })), + hasReachedAlertLimit: () => false, done: jest.fn().mockResolvedValue({}), }, findAlerts: jest.fn(), // TODO: does this stay? diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/__mocks__/es_results.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/__mocks__/es_results.ts index ebdf002986ffb..6c7d5d581ce61 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/__mocks__/es_results.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/__mocks__/es_results.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import type { SignalSourceHit, SignalSearchResponse, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatter.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatter.test.ts index 67deaec8e1d23..42c18e523f3d3 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatter.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatter.test.ts @@ -5,39 +5,50 @@ * 2.0. */ -import { buildReasonMessageUtil } from './reason_formatters'; -import type { SignalSourceHit } from './types'; +import { buildReasonMessageForThresholdAlert, buildReasonMessageUtil } from './reason_formatters'; + +const mergedDoc = { + _index: 'index-1', + _id: 'id-1', + fields: { + 'destination.address': ['9.99.99.9'], + 'destination.port': ['6789'], + 'event.category': ['test'], + 'file.name': ['sample'], + 'host.name': ['host'], + 'process.name': ['doingThings.exe'], + 'process.parent.name': ['didThings.exe'], + 'source.address': ['1.11.11.1'], + 'source.port': ['1234'], + 'user.name': ['test-user'], + '@timestamp': '2021-08-11T02:28:59.101Z', + }, +}; + +const genThresholdMergedDoc = (groupedKeys: Record) => ({ + _index: 'index-1', + _id: 'some-id', + _source: { + '@timestamp': '2022-08-16T11:01:09.848Z', + threshold_result: [Object], + ...groupedKeys, + }, +}); describe('reason_formatter', () => { - let name: string; + let ruleName: string; let severity: string; - let mergedDoc: SignalSourceHit; beforeAll(() => { - name = 'my-rule'; + ruleName = 'my-rule'; severity = 'medium'; - mergedDoc = { - _index: 'index-1', - _id: 'id-1', - fields: { - 'destination.address': ['9.99.99.9'], - 'destination.port': ['6789'], - 'event.category': ['test'], - 'file.name': ['sample'], - 'host.name': ['host'], - 'process.name': ['doingThings.exe'], - 'process.parent.name': ['didThings.exe'], - 'source.address': ['1.11.11.1'], - 'source.port': ['1234'], - 'user.name': ['test-user'], - '@timestamp': '2021-08-11T02:28:59.101Z', - }, - }; }); describe('buildReasonMessageUtil', () => { describe('when rule and mergedDoc are provided', () => { it('should return the full reason message', () => { - expect(buildReasonMessageUtil({ name, severity, mergedDoc })).toMatchInlineSnapshot( + expect( + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc }) + ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1:1234, destination 9.99.99.9:6789, by test-user on host created medium alert my-rule."` ); }); @@ -52,7 +63,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: updatedMergedDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: updatedMergedDoc }) ).toMatchInlineSnapshot( `"item one, item two event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1:1234, destination 9.99.99.9:6789, by test-user on host created medium alert my-rule."` ); @@ -68,7 +79,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: updatedMergedDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: updatedMergedDoc }) ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1:1234, destination 9.99.99.9:6789, by test-user created medium alert my-rule."` ); @@ -84,7 +95,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: updatedMergedDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: updatedMergedDoc }) ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1:1234, destination 9.99.99.9:6789, on host created medium alert my-rule."` ); @@ -100,7 +111,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: noDestinationPortDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: noDestinationPortDoc }) ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1:1234, destination 9.99.99.9 by test-user on host created medium alert my-rule."` ); @@ -115,7 +126,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: noDestinationPortDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: noDestinationPortDoc }) ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1:1234, by test-user on host created medium alert my-rule."` ); @@ -131,7 +142,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: noSourcePortDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: noSourcePortDoc }) ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1 destination 9.99.99.9:6789, by test-user on host created medium alert my-rule."` ); @@ -146,7 +157,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: noSourcePortDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: noSourcePortDoc }) ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, destination 9.99.99.9:6789, by test-user on host created medium alert my-rule."` ); @@ -163,7 +174,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: updatedMergedDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: updatedMergedDoc }) ).toMatchInlineSnapshot( `"test event with file sample, source 1.11.11.1:1234, destination 9.99.99.9:6789, by test-user on host created medium alert my-rule."` ); @@ -180,14 +191,61 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: updatedMergedDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: updatedMergedDoc }) ).toMatchInlineSnapshot(`"test event by test-user created medium alert my-rule."`); }); }); describe('when only rule is provided', () => { it('should return the reason message without host name or user name', () => { - expect(buildReasonMessageUtil({ name, severity })).toMatchInlineSnapshot(`""`); + expect(buildReasonMessageUtil({ name: ruleName, severity })).toMatchInlineSnapshot(`""`); + }); + }); + }); + + describe(`buildReasonMessageForThresholdAlert`, () => { + it('When thresold rule is grouped by user.name', () => { + const userName = 'Some User Name'; + const thresholdMergedDoc = genThresholdMergedDoc({ + 'user.name': userName, + }); + expect( + buildReasonMessageForThresholdAlert({ + name: ruleName, + severity, + mergedDoc: thresholdMergedDoc, + }) + ).toEqual(`event by ${userName} created ${severity} alert ${ruleName}.`); + }); + + it('When threshold rule is grouped by host.name', () => { + const hostName = 'Some Host Name'; + const thresholdMergedDoc = genThresholdMergedDoc({ + 'host.name': hostName, }); + + expect( + buildReasonMessageForThresholdAlert({ + name: ruleName, + severity, + mergedDoc: thresholdMergedDoc, + }) + ).toEqual(`event on ${hostName} created ${severity} alert ${ruleName}.`); + }); + it('When threshold rule is grouped by host.name and user.name', () => { + const hostName = 'Some Host Name'; + const userName = 'Some User Name'; + const thresholdMergedDoc = genThresholdMergedDoc({ + 'host.name': hostName, + 'user.name': userName, + }); + + expect( + buildReasonMessageForThresholdAlert({ + name: ruleName, + severity, + mergedDoc: thresholdMergedDoc, + }) + ).toEqual(`event by ${userName} on ${hostName} created ${severity} alert ${ruleName}.`); }); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatters.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatters.ts index 0b9148d995c74..88aa69186e58a 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatters.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatters.ts @@ -35,7 +35,7 @@ interface ReasonFields { } const getFieldsFromDoc = (mergedDoc: SignalSourceHit) => { const reasonFields: ReasonFields = {}; - const docToUse = mergedDoc?.fields || mergedDoc; + const docToUse = mergedDoc?.fields || mergedDoc?._source || mergedDoc; reasonFields.destinationAddress = getOr(null, 'destination.address', docToUse); reasonFields.destinationPort = getOr(null, 'destination.port', docToUse); 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 f4851e77f2048..e3c7f8f5ee50e 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 @@ -6,7 +6,7 @@ */ import { get } from 'lodash/fp'; -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import type { SignalSource } from '../../types'; import { filterFieldEntries } from '../utils/filter_field_entries'; import type { FieldsType, MergeStrategyFunction } from '../types'; 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 a5c811bc1a5c1..f5863533ea283 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 @@ -370,9 +370,9 @@ describe('merge_missing_fields_with_source', () => { /** * tests for https://github.com/elastic/kibana/issues/135963 * This test will fail when we replace the import - * import { set } from '@elastic/safer-lodash-set'; + * import { set } from '@kbn/safer-lodash-set'; * to use the fp version - * import { set } from '@elastic/safer-lodash-set/fp'; + * import { set } from '@kbn/safer-lodash-set/fp'; * and switch around the return inside of filteredEntries.reduce * to be the following: * return set(fieldsKey, valueToMerge, merged); 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 89695f6b562b0..c20f6b55301bd 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 @@ -6,7 +6,7 @@ */ import { get } from 'lodash/fp'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import type { SignalSource } from '../../types'; import { filterFieldEntries } from '../utils/filter_field_entries'; import type { FieldsType, MergeStrategyFunction } from '../types'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/recursive_unboxing_fields.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/recursive_unboxing_fields.ts index cc5096825951f..8bb490c2d62df 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/recursive_unboxing_fields.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/recursive_unboxing_fields.ts @@ -6,7 +6,7 @@ */ import { get } from 'lodash/fp'; -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import type { SearchTypes } from '../../../../../../common/detection_engine/types'; import type { FieldsType } from '../types'; diff --git a/x-pack/plugins/security_solution/server/lib/prebuilt_dev_tool_content/console_templates/enable_user_risk_score.console b/x-pack/plugins/security_solution/server/lib/prebuilt_dev_tool_content/console_templates/enable_user_risk_score.console index 5a457fb050e12..33e27178f0fb2 100644 --- a/x-pack/plugins/security_solution/server/lib/prebuilt_dev_tool_content/console_templates/enable_user_risk_score.console +++ b/x-pack/plugins/security_solution/server/lib/prebuilt_dev_tool_content/console_templates/enable_user_risk_score.console @@ -1,7 +1,7 @@ # Click the run button of each step to enable the module # Upload scripts # 1. Script to assign risk level based on risk score -PUT _scripts/ml_userriskscore_levels_script_{{space_name}} +PUT _scripts/ml_userriskscore_levels_script { "script": { "lang": "painless", @@ -10,7 +10,7 @@ PUT _scripts/ml_userriskscore_levels_script_{{space_name}} } # 2. Map script for the User Risk Score transform -PUT _scripts/ml_userriskscore_map_script_{{space_name}} +PUT _scripts/ml_userriskscore_map_script { "script": { "lang": "painless", "source": "// Get running sum of risk score per rule name per shard\\\\\nString rule_name = doc[\"signal.rule.name\"].value;\ndef stats = state.rule_risk_stats.getOrDefault(rule_name, 0.0);\nstats = doc[\"signal.rule.risk_score\"].value;\nstate.rule_risk_stats.put(rule_name, stats);" @@ -18,7 +18,7 @@ PUT _scripts/ml_userriskscore_map_script_{{space_name}} } # 3. Reduce script for the User Risk Score transform -PUT _scripts/ml_userriskscore_reduce_script_{{space_name}} +PUT _scripts/ml_userriskscore_reduce_script { "script": { "lang": "painless", @@ -28,7 +28,7 @@ PUT _scripts/ml_userriskscore_reduce_script_{{space_name}} # 4. Upload ingest pipeline # Ingest pipeline to add ingest timestamp and risk level to documents -PUT _ingest/pipeline/ml_userriskscore_ingest_pipeline_{{space_name}} +PUT _ingest/pipeline/ml_userriskscore_ingest_pipeline { "processors": [ { @@ -49,7 +49,7 @@ PUT _ingest/pipeline/ml_userriskscore_ingest_pipeline_{{space_name}} }, { "script": { - "id": "ml_userriskscore_levels_script_{{space_name}}", + "id": "ml_userriskscore_levels_script", "params": { "risk_score": "risk_stats.risk_score" } @@ -97,7 +97,7 @@ PUT _transform/ml_userriskscore_pivot_transform_{{space_name}} { "dest": { "index": "ml_user_risk_score_{{space_name}}", - "pipeline": "ml_userriskscore_ingest_pipeline_{{space_name}}" + "pipeline": "ml_userriskscore_ingest_pipeline" }, "frequency": "1h", "pivot": { @@ -112,7 +112,7 @@ PUT _transform/ml_userriskscore_pivot_transform_{{space_name}} "combine_script": "return state", "init_script": "state.rule_risk_stats = new HashMap();", "map_script": { - "id": "ml_userriskscore_map_script_{{space_name}}" + "id": "ml_userriskscore_map_script" }, "params": { "max_risk": 100, @@ -120,7 +120,7 @@ PUT _transform/ml_userriskscore_pivot_transform_{{space_name}} "zeta_constant": 2.612 }, "reduce_script": { - "id": "ml_userriskscore_reduce_script_{{space_name}}" + "id": "ml_userriskscore_reduce_script" } } } @@ -135,7 +135,7 @@ PUT _transform/ml_userriskscore_pivot_transform_{{space_name}} }, "source": { "index": [ - ".siem-signals-{{space_name}}" + ".alerts-security.alerts-{{space_name}}" ], "query": { "bool": { diff --git a/x-pack/plugins/security_solution/server/lib/prebuilt_dev_tool_content/routes/__snapshots__/read_prebuilt_dev_tool_content_route.test.ts.snap b/x-pack/plugins/security_solution/server/lib/prebuilt_dev_tool_content/routes/__snapshots__/read_prebuilt_dev_tool_content_route.test.ts.snap index 7669582597b37..9a81a32f80eed 100644 --- a/x-pack/plugins/security_solution/server/lib/prebuilt_dev_tool_content/routes/__snapshots__/read_prebuilt_dev_tool_content_route.test.ts.snap +++ b/x-pack/plugins/security_solution/server/lib/prebuilt_dev_tool_content/routes/__snapshots__/read_prebuilt_dev_tool_content_route.test.ts.snap @@ -4,7 +4,7 @@ exports[`readPrebuiltDevToolContentRoute should read content from "enable_host_r "# Click the run button of each step to enable the module # Upload scripts # 1. Script to assign risk level based on risk score -PUT _scripts/ml_userriskscore_levels_script_default +PUT _scripts/ml_userriskscore_levels_script { \\"script\\": { \\"lang\\": \\"painless\\", @@ -13,7 +13,7 @@ PUT _scripts/ml_userriskscore_levels_script_default } # 2. Map script for the User Risk Score transform -PUT _scripts/ml_userriskscore_map_script_default +PUT _scripts/ml_userriskscore_map_script { \\"script\\": { \\"lang\\": \\"painless\\", \\"source\\": \\"// Get running sum of risk score per rule name per shard\\\\\\\\\\\\\\\\\\\\nString rule_name = doc[\\\\\\"signal.rule.name\\\\\\"].value;\\\\ndef stats = state.rule_risk_stats.getOrDefault(rule_name, 0.0);\\\\nstats = doc[\\\\\\"signal.rule.risk_score\\\\\\"].value;\\\\nstate.rule_risk_stats.put(rule_name, stats);\\" @@ -21,7 +21,7 @@ PUT _scripts/ml_userriskscore_map_script_default } # 3. Reduce script for the User Risk Score transform -PUT _scripts/ml_userriskscore_reduce_script_default +PUT _scripts/ml_userriskscore_reduce_script { \\"script\\": { \\"lang\\": \\"painless\\", @@ -31,7 +31,7 @@ PUT _scripts/ml_userriskscore_reduce_script_default # 4. Upload ingest pipeline # Ingest pipeline to add ingest timestamp and risk level to documents -PUT _ingest/pipeline/ml_userriskscore_ingest_pipeline_default +PUT _ingest/pipeline/ml_userriskscore_ingest_pipeline { \\"processors\\": [ { @@ -52,7 +52,7 @@ PUT _ingest/pipeline/ml_userriskscore_ingest_pipeline_default }, { \\"script\\": { - \\"id\\": \\"ml_userriskscore_levels_script_default\\", + \\"id\\": \\"ml_userriskscore_levels_script\\", \\"params\\": { \\"risk_score\\": \\"risk_stats.risk_score\\" } @@ -100,7 +100,7 @@ PUT _transform/ml_userriskscore_pivot_transform_default { \\"dest\\": { \\"index\\": \\"ml_user_risk_score_default\\", - \\"pipeline\\": \\"ml_userriskscore_ingest_pipeline_default\\" + \\"pipeline\\": \\"ml_userriskscore_ingest_pipeline\\" }, \\"frequency\\": \\"1h\\", \\"pivot\\": { @@ -115,7 +115,7 @@ PUT _transform/ml_userriskscore_pivot_transform_default \\"combine_script\\": \\"return state\\", \\"init_script\\": \\"state.rule_risk_stats = new HashMap();\\", \\"map_script\\": { - \\"id\\": \\"ml_userriskscore_map_script_default\\" + \\"id\\": \\"ml_userriskscore_map_script\\" }, \\"params\\": { \\"max_risk\\": 100, @@ -123,7 +123,7 @@ PUT _transform/ml_userriskscore_pivot_transform_default \\"zeta_constant\\": 2.612 }, \\"reduce_script\\": { - \\"id\\": \\"ml_userriskscore_reduce_script_default\\" + \\"id\\": \\"ml_userriskscore_reduce_script\\" } } } @@ -138,7 +138,7 @@ PUT _transform/ml_userriskscore_pivot_transform_default }, \\"source\\": { \\"index\\": [ - \\".siem-signals-default\\" + \\".alerts-security.alerts-default\\" ], \\"query\\": { \\"bool\\": { diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts b/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts index 0d5cf7684f02b..97b6ec743d109 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts @@ -5,7 +5,7 @@ * 2.0. */ import type * as rt from 'io-ts'; -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import readline from 'readline'; import fs from 'fs'; import type { Readable } from 'stream'; 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 index c97f7053a5098..fa9c9250e2190 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import type { SavedObject, diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts index d149b8c0fd7ba..a1918b628c1d4 100644 --- a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts +++ b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts @@ -144,12 +144,7 @@ describe('When using Artifacts Exceptions BaseValidator', () => { }); it('should throw if policy ids for by policy artifacts are not valid', async () => { - packagePolicyService.getByIDs.mockResolvedValue([ - { - id: '123', - version: undefined, - } as PackagePolicy, - ]); + packagePolicyService.getByIDs.mockResolvedValue([]); await expect(initValidator()._validateByPolicyItem(exceptionLikeItem)).rejects.toBeInstanceOf( EndpointArtifactExceptionValidationError diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.ts b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.ts index 04a7d5a09875b..872d8da7cdb3d 100644 --- a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.ts +++ b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.ts @@ -131,7 +131,9 @@ export class BaseValidator { return; } - const policiesFromFleet = await packagePolicy.getByIDs(internalReadonlySoClient, policyIds); + const policiesFromFleet = await packagePolicy.getByIDs(internalReadonlySoClient, policyIds, { + ignoreMissing: true, + }); if (!policiesFromFleet) { throw new EndpointArtifactExceptionValidationError( @@ -139,9 +141,9 @@ export class BaseValidator { ); } - const invalidPolicyIds = policiesFromFleet - .filter((policy) => policy.version === undefined) - .map((policy) => policy.id); + const invalidPolicyIds = policyIds.filter( + (policyId) => !policiesFromFleet.some((policy) => policyId === policy.id) + ); if (invalidPolicyIds.length) { throw new EndpointArtifactExceptionValidationError( diff --git a/x-pack/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.ts b/x-pack/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.ts index a20e5aba9fda1..f44ad77e67929 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.ts @@ -6,7 +6,7 @@ */ import { mapValues, isObject, isArray } from 'lodash/fp'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { toArray } from '../../../common/utils/to_array'; import { isGeoField } from '../../../common/utils/field_formatters'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/helpers/get_flattened_fields.ts b/x-pack/plugins/security_solution/server/search_strategy/helpers/get_flattened_fields.ts index d0a9991f866db..f40edfc5914df 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/helpers/get_flattened_fields.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/helpers/get_flattened_fields.ts @@ -4,7 +4,7 @@ * 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 { set } from '@kbn/safer-lodash-set'; import { get, isEmpty } from 'lodash/fp'; import { toObjectArrayOfStrings } from '../../../common/utils/to_array'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.ts index 3e92a733d12bd..93ce3a15009b7 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import { get, has } from 'lodash/fp'; import { hostFieldsMap } from '../../../../../../common/ecs/ecs_fields'; import type { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts index 3f2a052ffc1b1..0c1ef643e663f 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import { get, has, head } from 'lodash/fp'; import type { IScopedClusterClient, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.ts index 15d1b3029a96d..3cae17446439f 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.ts @@ -6,7 +6,7 @@ */ import { get } from 'lodash/fp'; -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import type { ProcessHits, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts index 60cd570478488..53623d44205b3 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts @@ -6,7 +6,7 @@ */ import { get, getOr, isEmpty } from 'lodash/fp'; -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import { toObjectArrayOfStrings } from '../../../../../../common/utils/to_array'; import { sourceFieldsMap, hostFieldsMap } from '../../../../../../common/ecs/ecs_fields'; import type { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/details/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/details/helpers.ts index cf18f08476fcd..f6c9f1d194215 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/details/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/details/helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import { get, has } from 'lodash/fp'; import type { UserAggEsItem, diff --git a/x-pack/plugins/session_view/common/constants.ts b/x-pack/plugins/session_view/common/constants.ts index 371a54418c9b7..5bf0dc53701fc 100644 --- a/x-pack/plugins/session_view/common/constants.ts +++ b/x-pack/plugins/session_view/common/constants.ts @@ -5,35 +5,46 @@ * 2.0. */ -export const PROCESS_EVENTS_ROUTE = '/internal/session_view/process_events_route'; -export const ALERTS_ROUTE = '/internal/session_view/alerts_route'; -export const ALERT_STATUS_ROUTE = '/internal/session_view/alert_status_route'; -export const SESSION_ENTRY_LEADERS_ROUTE = '/internal/session_view/session_entry_leaders_route'; +// routes +export const PROCESS_EVENTS_ROUTE = '/internal/session_view/process_events'; +export const ALERTS_ROUTE = '/internal/session_view/alerts'; +export const ALERT_STATUS_ROUTE = '/internal/session_view/alert_status'; +export const IO_EVENTS_ROUTE = '/internal/session_view/io_events'; +export const GET_TOTAL_IO_BYTES_ROUTE = '/internal/session_view/get_total_io_bytes'; + +// index patterns export const PROCESS_EVENTS_INDEX = '*:logs-endpoint.events.process*,logs-endpoint.events.process*'; // match on both cross cluster and local indices export const PREVIEW_ALERTS_INDEX = '.preview.alerts-security.alerts-default'; + +// field properties export const ENTRY_SESSION_ENTITY_ID_PROPERTY = 'process.entry_leader.entity_id'; export const ALERT_UUID_PROPERTY = 'kibana.alert.uuid'; export const ALERT_ORIGINAL_TIME_PROPERTY = 'kibana.alert.original_time'; -export const ALERT_STATUS = { - OPEN: 'open', - ACKNOWLEDGED: 'acknowledged', - CLOSED: 'closed', -}; +export const TOTAL_BYTES_CAPTURED_PROPERTY = 'process.io.total_bytes_captured'; +// page sizes export const PROCESS_EVENTS_PER_PAGE = 500; export const ALERTS_PER_PROCESS_EVENTS_PAGE = 1500; export const ALERTS_PER_PAGE = 100; -export const ALERTS_IN_FIRST_PAGE = 8; - -// when showing the count of alerts in details panel tab, if the number -// exceeds ALERT_COUNT_THRESHOLD we put a + next to it, e.g 500+ -export const ALERT_COUNT_THRESHOLD = 500; +export const IO_EVENTS_PER_PAGE = 2; // react-query caching keys export const QUERY_KEY_PROCESS_EVENTS = 'sessionViewProcessEvents'; export const QUERY_KEY_ALERTS = 'sessionViewAlerts'; -export const LOCAL_STORAGE_DISPLAY_OPTIONS_KEY = 'sessionView:displayOptions'; +export const QUERY_KEY_IO_EVENTS = 'sessionViewIOEvents'; +export const QUERY_KEY_GET_TOTAL_IO_BYTES = 'sessionViewGetTotalIOBytes'; +// other +export const ALERT_STATUS = { + OPEN: 'open', + ACKNOWLEDGED: 'acknowledged', + CLOSED: 'closed', +}; +export const LOCAL_STORAGE_DISPLAY_OPTIONS_KEY = 'sessionView:displayOptions'; export const MOUSE_EVENT_PLACEHOLDER = { stopPropagation: () => undefined } as React.MouseEvent; - export const DEBOUNCE_TIMEOUT = 500; +export const DEFAULT_TTY_PLAYSPEED_MS = 40; // milli seconds per line of tty output. + +// when showing the count of alerts in details panel tab, if the number +// exceeds ALERT_COUNT_THRESHOLD we put a + next to it, e.g 999+ +export const ALERT_COUNT_THRESHOLD = 999; diff --git a/x-pack/plugins/session_view/common/mocks/responses/session_view_io_events.mock.ts b/x-pack/plugins/session_view/common/mocks/responses/session_view_io_events.mock.ts new file mode 100644 index 0000000000000..33b9ac56b035d --- /dev/null +++ b/x-pack/plugins/session_view/common/mocks/responses/session_view_io_events.mock.ts @@ -0,0 +1,228 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ProcessEventResults } from '../../types/process_tree'; + +export const sessionViewIOEventsMock: ProcessEventResults = { + events: [ + { + _index: 'logs-endpoint.events.process', + _id: '1', + _source: { + '@timestamp': '2022-07-14T11:16:29.570Z', + message: 'hello world security', + event: { + action: 'text_output', + }, + process: { + entity_id: '1', + name: 'bash', + executable: '/bin/bash', + entry_leader: { + entity_id: '1', + }, + io: { + type: 'tty', + total_bytes_captured: 1024, + total_bytes_skipped: 0, + bytes_skipped: [], + text: "256\n,\n Some Companies Puppet instance\n | | | CentOS Stream release 8 on x86_64\n .=/ = = =| =| = === = Load average: 1.23, 1.01, 0.63\n | || || || || || | | | | \n /= = = =' =' =' ' =' Hostname ********\n \\ Type xyz\n o Datacenter ********\n Cluster ********\n\n\n\n\n,0 loaded units listed. Pass --all to see loaded but inactive units, too.\nTo show all installed unit files use 'systemctl list-unit-files'.\n", + }, + }, + }, + }, + + { + _index: 'logs-endpoint.events.process', + _id: '2', + _source: { + '@timestamp': '2022-07-14T11:16:30.570Z', + message: 'hello world security', + event: { + action: 'text_output', + }, + process: { + entity_id: '2', + name: 'vim', + executable: '/bin/vi', + entry_leader: { + entity_id: '1', + }, + io: { + type: 'tty', + total_bytes_captured: 1024, + total_bytes_skipped: 0, + bytes_skipped: [], + text: ',\u001b[?2004h\u001b[?1049h\u001b[22;0;0t\u001b[?1h\u001b=\u001b[?2004h\u001b[1;59r\u001b[?12h\u001b[?12l\u001b[27m\u001b[29m\u001b[m\u001b[H\u001b[2J\u001b[?25l\u001b[59;1H"/usr/local/bin/galera_traffic_start.sh" [readonly] 14L, 397C\u001b[1;1H#!/bin/env bash\n# Copyright (C) 2022, ********(R) Corporation. All rights reserved.\n\n# Script for setting the reject of queries in Galera\n\nmysql -h127.0.0.1 -P6033 -uroot -e "set global wsrep_reject_queries=\'NONE\'" 2>&1\nRC=$?\n\nif [[ $RC != 0 ]]; then\n >&2 echo "Failed to unset the reject of queries on Galera node, exiting."\n exit $RC\nelse\n echo "Successfully unset the reject of queries."\nfi\n\u001b[94m~ \u001b[16;1H~ \u001b[17;1H~ \u001b[18;1H~ \u001b[19;1H~ \u001b[20;1H~ \u001b[21;1H~ \u001b[22;1H~ \u001b[23;1H~ \u001b[24;1H~ \u001b[25;1H~ \u001b[26;1H~ \u001b[27;1H~ \u001b[28;1H~ \u001b[29;1H~ \u001b[30;1H~ \u001b[31;1H~ \u001b[32;1H~ \u001b[33;1H~ \u001b[34;1H~ \u001b[35;1H~ \u001b[36;1H~ \u001b[37;1H~ \u001b[38;1H~ \u001b[39;1H~ \u001b[40;1H~ \u001b[41;1H~ \u001b[42;1H~ \u001b[43;1H~ \u001b[44;1H~ \u001b[45;1H~ \u001b[46;1H~ \u001b[47;1H~ \u001b[48;1H~ \u001b[49;1H~ \u001b[50;1H~ \u001b[51;1H~ \u001b[52;1H~ \u001b[53;1H~ \u001b[54;1H~ \u001b[55;1H~ \u001b[56;1H~ \u001b[57;1H~ \u001b[58;1H~ \u001b[1;1H\u001b[?25h\u0007\u001b[?25l\u001b[m\u001b[59;1H\u001b[K\u001b[59;1H:\u001b[?2004h\u001b[?25hq\r\u001b[?25l\u001b[?2004l\u001b[59;1H\u001b[K\u001b[59;1H\u001b[?2004l\u001b[?1l\u001b>\u001b[?25h\u001b[?1049l\u001b[23;0;0t,\u001b[?2004h\u001b[?1049h\u001b[22;0;0t\u001b[?1h\u001b=\u001b[?2004h\u001b[1;59r\u001b[?12h\u001b[?12l\u001b[27m\u001b[29m\u001b[m\u001b[H\u001b[2J\u001b[?25l\u001b[59;1H"/usr/local/bin/galera_traffic_stop.sh" [readonly] 115L, 3570C\u001b[1;1H#!/bin/env bash\n# Copyright (C) 2022, ********(R) Corporation. All rights reserved.\n\n# Script for rejecting connection on Galera cluster node, either gracefully or not,\n# depending on supplied arguments.\n\nfunction usage() {\n echo "\n This script disables DB connections to Galera node.\n The default is to stop them gracefully.\n\n Usage: $0 [-h] [-w ] [-s ] [-x]\n\n Options:\n -h Prints this help.\n -w Number of seconds for waiting to close the connections.\u001b[17;11HDefault value is to wait for mysql-wait_timeout.\n -s Sleep interval between connections checks.\n -x Kills all connections immediately. Other options are ignored."\n exit\n}\n', + }, + }, + }, + }, + + { + _index: 'logs-endpoint.events.process', + _id: '3', + _source: { + '@timestamp': '2022-07-14T11:16:31.570Z', + message: 'hello world security', + event: { + action: 'text_output', + }, + process: { + entity_id: '2', + name: 'vim', + executable: '/bin/vi', + entry_leader: { + entity_id: '1', + }, + io: { + type: 'tty', + total_bytes_captured: 1024, + total_bytes_skipped: 0, + bytes_skipped: [], + text: '\nfunction get_number_db_connections() {\n # count current\n DB_CONNECTIONS_NUMBER=$(mysql -h127.0.0.1 -P6032 -uadmin -N --silent -e "select count(1) from stats_mysql_processlist where user = \'$DB_USER\' and db like \'db\\_%\' escapee\u001b[26;1H \'\\\'")\n}\n\nfunction set_number_grace_seconds() {\n local mysql_wait_timeout_ms=$(mysql -h127.0.0.1 -P6032 -uadmin -N --silent -e "select variable_value from global_variables where variable_name = \'mysql-wait_timeout\'")\n GRACE_PERIOD=$((($mysql_wait_timeout_ms+1000-1)/1000))\n}\n\nfunction wait_for_connections() {\n local number_of_loops=$(((($GRACE_PERIOD+$SLEEP_INTERVAL-1)/$SLEEP_INTERVAL)))\u001b[37;5Hecho "Waiting for connections to close for up to $GRACE_PERIOD seconds"\u001b[39;5Hfor i in $(seq 0 $number_of_loops); do\u001b[40;9Hget_number_db_connections\u001b[41;9Hif [[ $DB_CONNECTIONS_NUMBER -eq 0 ]]; then\u001b[42;13Hecho "No connection found for user $DB_USER to this node"\u001b[43;13Hbreak\u001b[44;9Helse\u001b[45;13Hecho "$DB_CONNECTIONS_NUMBER connection(s) found, waiting for ${SLEEP_INTERVAL}s, round $i"\u001b[46;13Hsleep $SLEEP_INTERVAL\u001b[47;9Hfi\n done\n}\n\nfunction parse_args() {\n while getopts \'hs:w:x\' opt; do\u001b[53;9Hcase "$opt" in\u001b[54;9Hh)\u001b[55;13Husage\u001b[56;13H;;\u001b[57;9Hs)\u001b[58;13Hif ! [[ $OPTARG =~ ^[0-9]+$ ]]; then\u001b[1;1H\u001b[?25h\u001b[?25l\u001b[59;1H\u001b[K\u001b[59;1H:\u001b[?2004h\u001b[?25hset number\r\u001b[?25l\u001b[1;1H\u001b[38;5;130m 1 \u001b[m#!/bin/env bash\n\u001b[38;5;130m 2 \u001b[m# Copyright (C) 2022, ********(R) Corporation. All rights reserved.\n\u001b[38;5;130m 3 \n 4 \u001b[m# Script for rejecting connection on Galera cluster node, either gracefully or not,\n\u001b[38;5;130m 5 \u001b[m# depending on supplied arguments.\n\u001b[38;5;130m 6 \n 7 \u001b[mfunction usage() {\n\u001b[38;5;130m 8 \u001b[m echo "\n\u001b[38;5;130m 9 \u001b[m This script disables DB connections to Galera node.\n\u001b[38;5;130m 10 \u001b[m The default is to stop them gracefully.\n\u001b[38;5;130m 11 \n 12 \u001b[m Usage: $0 [-h] [-w ] [-s ] [-x]\n\u001b[38;5;130m 13 \n 14 \u001b[m Options:\n\u001b[38;5;130m 15 \u001b[m -h Prints this help.\n\u001b[38;5;130m 16 \u001b[m -w Number of seconds for waiting to close the connections.\n\u001b[38;5;130m 17 \u001b[m Default value is to wait for mysql-wait_timeout.\n\u001b[38;5;130m 18 \u001b[m -s Sleep interval between connections checks.\n\u001b[38;5;130m 19 \u001b[m -x Kills all connections immediately. Other options are ignored."\n\u001b[38;5;130m 20 \u001b[m exit\n\u001b[38;5;130m 21 \u001b[m}\n\u001b[38;5;130m 22 \n 23 \u001b[mfunction get_number_db_connections() {\n\u001b[38;5;130m 24 \u001b[m # count current\n\u001b[38;5;130m 25 \u001b[m DB_CONNECTIONS_NUMBER=$(mysql -h127.0.0.1 -P6032 -uadmin -N --silent -e "select count(1) from stats_mysql_processlist where user = \'$DB_USER\' and db like \'db\\_%%\u001b[26;1H\u001b[38;5;130m \u001b[m\' escape \'\\\'")\n\u001b[38;5;130m 26 \u001b[m}\n\u001b[38;5;130m 27 \n 28 \u001b[mfunction set_number_grace_seconds() {\n\u001b[38;5;130m 29 \u001b[m local mysql_wait_timeout_ms=$(mysql -h127.0.0.1 -P6032 -uadmin -N --silent -e "select variable_value from global_variables where variable_name = \'mysql-wait_timm\u001b[31;1H\u001b[38;5;130m \u001b[meout\'")\u001b[31;16H\u001b[K\u001b[32;1H\u001b[38;5;130m 30 \u001b[m GRACE_PERIOD=$((($mysql_wait_timeout_ms+1000-1)/1000))\n\u001b[38;5;130m 31 \u001b[m}\n\u001b[38;5;130m 32 \u001b[m\u001b[34;10H\u001b[K\u001b[35;1H\u001b[38;5;130m 33 \u001b[mfunction wait_for_connections() {\u001b[35;42H\u001b[K\u001b[36;1H\u001b[38;5;130m 34 \u001b[m local number_of_loops=$(((($GRACE_PERIOD+$SLEEP_INTERVAL-1)/$SLEEP_INTERVAL)))\n\u001b[38;5;130m 35 \u001b[m\u001b[37;10H\u001b[K\u001b[38;1H\u001b[38;5;130m 36 \u001b[m echo "Waiting for connections to close for up to $GRACE_PERIOD seconds"\n\u001b[38;5;130m 37 \u001b[m\u001b[39;9H\u001b[K\u001b[40;1H\u001b[38;5;130m 38 \u001b[m for i in $(seq 0 $number_of_loops); do\n', + }, + }, + }, + }, + + { + _index: 'logs-endpoint.events.process', + _id: '4', + _source: { + '@timestamp': '2022-07-14T11:16:32.570Z', + message: 'hello world security', + event: { + action: 'text_output', + }, + process: { + entity_id: '2', + name: 'vim', + executable: '/bin/vi', + entry_leader: { + entity_id: '1', + }, + io: { + type: 'tty', + total_bytes_captured: 1024, + total_bytes_skipped: 0, + bytes_skipped: [], + text: '\u001b[38;5;130m 39 \u001b[m get_number_db_connections\u001b[41;42H\u001b[K\u001b[42;1H\u001b[38;5;130m 40 \u001b[m if [[ $DB_CONNECTIONS_NUMBER -eq 0 ]]; then\u001b[42;60H\u001b[K\u001b[43;1H\u001b[38;5;130m 41 \u001b[m echo "No connection found for user $DB_USER to this node"\n\u001b[38;5;130m 42 \u001b[m \u001b[8Cbreak\n\u001b[38;5;130m 43 \u001b[m else\u001b[45;21H\u001b[K\u001b[46;1H\u001b[38;5;130m 44 \u001b[m echo "$DB_CONNECTIONS_NUMBER connection(s) found, waiting for ${SLEEP_INTERVAL}s, round $i"\n\u001b[38;5;130m 45 \u001b[m \u001b[10Csleep $SLEEP_INTERVAL\n\u001b[38;5;130m 46 \u001b[m\u001b[8Cfi\n\u001b[38;5;130m 47 \u001b[m done\n\u001b[38;5;130m 48 \u001b[m}\n\u001b[38;5;130m 49 \u001b[m\u001b[51;10H\u001b[K\u001b[52;1H\u001b[38;5;130m 50 \u001b[mfunction parse_args() {\u001b[52;33H\u001b[K\u001b[53;1H\u001b[38;5;130m 51 \u001b[m while getopts \'hs:w:x\' opt; do\n\u001b[38;5;130m 52 \u001b[m case "$opt" in\n\u001b[38;5;130m 53 \u001b[m h)\n\u001b[38;5;130m 54 \u001b[m usage\n\u001b[38;5;130m 55 \u001b[m \u001b[10C;;\n\u001b[38;5;130m 56 \u001b[m s)\u001b[58;19H\u001b[K\u001b[1;9H\u001b[?25h\u001b[?25l\u001b[27m\u001b[29m\u001b[m\u001b[H\u001b[2J\u001b[1;1H\u001b[38;5;130m 58 \u001b[m\u001b[16C>&2 echo "Sleep interval (-s) must be a number"\n\u001b[38;5;130m 59 \u001b[m\u001b[16Cexit 1\n\u001b[38;5;130m 60 \u001b[m\u001b[12Cfi\n\u001b[38;5;130m 61 \u001b[m\u001b[12CARG_SLEEP_INTERVAL="$OPTARG"\n\u001b[38;5;130m 62 \u001b[m\u001b[12C;;\n\u001b[38;5;130m 63 \u001b[m\u001b[8Cw)\n\u001b[38;5;130m 64 \u001b[m\u001b[12Cif ! [[ $OPTARG =~ ^[0-9]+$ ]]; then\n\u001b[38;5;130m 65 \u001b[m\u001b[16C>&2 echo "Wait timeout (-w) must be a number"\n\u001b[38;5;130m 66 \u001b[m\u001b[16Cexit 1\n\u001b[38;5;130m 67 \u001b[m\u001b[12Cfi\n\u001b[38;5;130m 68 \u001b[m\u001b[12CARG_GRACE_PERIOD="$OPTARG"\n\u001b[38;5;130m 69 \u001b[m\u001b[12C;;\n\u001b[38;5;130m 70 \u001b[m\u001b[8Cx)\n\u001b[38;5;130m 71 \u001b[m\u001b[12CARG_KILL_IMMEDIATELY=1\n\u001b[38;5;130m 72 \u001b[m\u001b[12C;;\n\u001b[38;5;130m 73 \u001b[m\u001b[8Cesac\n\u001b[38;5;130m 74 \u001b[m done\n\u001b[38;5;130m 75 \n 76 \u001b[m GRACE_PERIOD=${ARG_GRACE_PERIOD:--1}\n\u001b[38;5;130m 77 \u001b[m SLEEP_INTERVAL=${ARG_SLEEP_INTERVAL:-30}\n\u001b[38;5;130m 78 \u001b[m KILL_IMMEDIATELY=${ARG_KILL_IMMEDIATELY:-0}\n\u001b[38;5;130m 79 \u001b[m}\n\u001b[38;5;130m 80 \n 81 \u001b[mDB_USER="rolap01"\n\u001b[38;5;130m 82 \n 83 \u001b[mparse_args $@\n\u001b[38;5;130m 84 \n 85 \u001b[mif [[ $KILL_IMMEDIATELY == 1 ]]; then\n\u001b[38;5;130m 86 \u001b[m echo "WARNING: Not waiting for connections to close gracefully"\n\u001b[38;5;130m 87 \u001b[m echo "Press any key to continue... wsrep_reject_queries will be set to \'ALL_KILL\'"\n\u001b[38;5;130m 88 \u001b[m read a\n\u001b[38;5;130m 89 \u001b[m mysql -h127.0.0.1 -P3306 -uroot -e "set global wsrep_reject_queries=\'ALL_KILL\'"\n\u001b[38;5;130m 90 \u001b[melse\n\u001b[38;5;130m 91 \u001b[m # Stop accepting queries in mariadb, do not kill opened connections\n\u001b[38;5;130m 92 \u001b[m mysql -h127.0.0.1 -P3306 -uroot -e "set global wsrep_reject_queries=\'ALL\'"\n\u001b[38;5;130m 93 \u001b[mfi\n\u001b[38;5;130m 94 \n 95 \u001b[mexit_code=$?\n', + }, + }, + }, + }, + + { + _index: 'logs-endpoint.events.process', + _id: '5', + _source: { + '@timestamp': '2022-07-14T11:16:33.570Z', + message: 'hello world security', + event: { + action: 'text_output', + }, + process: { + entity_id: '2', + name: 'vim', + executable: '/bin/vi', + entry_leader: { + entity_id: '1', + }, + io: { + type: 'tty', + total_bytes_captured: 1024, + total_bytes_skipped: 0, + bytes_skipped: [], + text: '\u001b[38;5;130m 96 \u001b[mif [[ $exit_code != 0 ]]; then\n\u001b[38;5;130m 97 \u001b[m >&2 echo "Failed to set the reject of queries on Galera node, exiting."\n\u001b[38;5;130m 98 \u001b[m exit $exit_code\n\u001b[38;5;130m 99 \u001b[melse\n\u001b[38;5;130m 100 \u001b[m echo "Successfully stopped accepting queries."\n\u001b[38;5;130m 101 \u001b[m if [[ $KILL_IMMEDIATELY == 1 ]]; then\n\u001b[38;5;130m 102 \u001b[m\u001b[8Cexit\n\u001b[38;5;130m 103 \u001b[m fi\n\u001b[38;5;130m 104 \u001b[mfi\n\u001b[38;5;130m 105 \n 106 \u001b[mif [[ $GRACE_PERIOD == -1 ]]; then\n\u001b[38;5;130m 107 \u001b[m set_number_grace_seconds\n\u001b[38;5;130m 108 \u001b[mfi\n\u001b[38;5;130m 109 \n 110 \u001b[mwait_for_connections\n\u001b[38;5;130m 111 \u001b[mif [[ $DB_CONNECTIONS_NUMBER != 0 ]]; then\n\u001b[38;5;130m 112 \u001b[m get_number_db_connections\n\u001b[38;5;130m 113 \u001b[m >&2 echo "ERROR: There are still $DB_CONNECTIONS_NUMBER opened DB connections."\n\u001b[38;5;130m 114 \u001b[m exit 3\n\u001b[38;5;130m 115 \u001b[mfi\b\b\u001b[?25h\u001b[?25l\u001b[27m\u001b[29m\u001b[m\u001b[H\u001b[2J\u001b[1;1H\u001b[38;5;130m 1 \u001b[m#!/bin/env bash\n\u001b[38;5;130m 2 \u001b[m# Copyright (C) 2022, ********(R) Corporation. All rights reserved.\n\u001b[38;5;130m 3 \n 4 \u001b[m# Script for rejecting connection on Galera cluster node, either gracefully or not,\n\u001b[38;5;130m 5 \u001b[m# depending on supplied arguments.\n\u001b[38;5;130m 6 \n 7 \u001b[mfunction usage() {\n\u001b[38;5;130m 8 \u001b[m echo "\n\u001b[38;5;130m 9 \u001b[m This script disables DB connections to Galera node.\n\u001b[38;5;130m 10 \u001b[m The default is to stop them gracefully.\n\u001b[38;5;130m 11 \n 12 \u001b[m Usage: $0 [-h] [-w ] [-s ] [-x]\n\u001b[38;5;130m 13 \n 14 \u001b[m Options:\n\u001b[38;5;130m 15 \u001b[m -h Prints this help.\n\u001b[38;5;130m 16 \u001b[m -w Number of seconds for waiting to close the connections.\n\u001b[38;5;130m 17 \u001b[m\u001b[10CDefault value is to wait for mysql-wait_timeout.\n\u001b[38;5;130m 18 \u001b[m -s Sleep interval between connections checks.\n\u001b[38;5;130m 19 \u001b[m -x Kills all connections immediately. Other options are ignored."\n\u001b[38;5;130m 20 \u001b[m exit\n\u001b[38;5;130m 21 \u001b[m}\n\u001b[38;5;130m 22 \n 23 \u001b[mfunction get_number_db_connections() {\n\u001b[38;5;130m 24 \u001b[m # count current\n\u001b[38;5;130m 25 \u001b[m DB_CONNECTIONS_NUMBER=$(mysql -h127.0.0.1 -P6032 -uadmin -N --silent -e "select count(1) from stats_mysql_processlist where user = \'$DB_USER\' and db like \'db\\_%%\u001b[26;1H\u001b[38;5;130m \u001b[m\' escape \'\\\'")\n\u001b[38;5;130m 26 \u001b[m}\n\u001b[38;5;130m 27 \n 28 \u001b[mfunction set_number_grace_seconds() {\n\u001b[38;5;130m 29 \u001b[m local mysql_wait_timeout_ms=$(mysql -h127.0.0.1 -P6032 -uadmin -N --silent -e "select variable_value from global_variables where variable_name = \'mysql-wait_timm\u001b[31;1H\u001b[38;5;130m \u001b[meout\'")\n\u001b[38;5;130m 30 \u001b[m GRACE_PERIOD=$((($mysql_wait_timeout_ms+1000-1)/1000))\n\u001b[38;5;130m 31 \u001b[m}\n\u001b[38;5;130m 32 \n', + }, + }, + }, + }, + + { + _index: 'logs-endpoint.events.process', + _id: '6', + _source: { + '@timestamp': '2022-07-14T11:16:34.570Z', + message: 'hello world security', + event: { + action: 'text_output', + }, + process: { + entity_id: '2', + name: 'vim', + executable: '/bin/vi', + entry_leader: { + entity_id: '1', + }, + io: { + type: 'tty', + total_bytes_captured: 1024, + total_bytes_skipped: 0, + bytes_skipped: [], + text: ' 33 \u001b[mfunction wait_for_connections() {\n\u001b[38;5;130m 34 \u001b[m local number_of_loops=$(((($GRACE_PERIOD+$SLEEP_INTERVAL-1)/$SLEEP_INTERVAL)))\n\u001b[38;5;130m 35 \n 36 \u001b[m echo "Waiting for connections to close for up to $GRACE_PERIOD seconds"\n\u001b[38;5;130m 37 \n 38 \u001b[m for i in $(seq 0 $number_of_loops); do\n\u001b[38;5;130m 39 \u001b[m\u001b[8Cget_number_db_connections\n\u001b[38;5;130m 40 \u001b[m\u001b[8Cif [[ $DB_CONNECTIONS_NUMBER -eq 0 ]]; then\n\u001b[38;5;130m 41 \u001b[m\u001b[12Cecho "No connection found for user $DB_USER to this node"\n\u001b[38;5;130m 42 \u001b[m\u001b[12Cbreak\n\u001b[38;5;130m 43 \u001b[m\u001b[8Celse\n\u001b[38;5;130m 44 \u001b[m\u001b[12Cecho "$DB_CONNECTIONS_NUMBER connection(s) found, waiting for ${SLEEP_INTERVAL}s, round $i"\n\u001b[38;5;130m 45 \u001b[m\u001b[12Csleep $SLEEP_INTERVAL\n\u001b[38;5;130m 46 \u001b[m\u001b[8Cfi\n\u001b[38;5;130m 47 \u001b[m done\n\u001b[38;5;130m 48 \u001b[m}\n\u001b[38;5;130m 49 \n 50 \u001b[mfunction parse_args() {\n\u001b[38;5;130m 51 \u001b[m while getopts \'hs:w:x\' opt; do\n\u001b[38;5;130m 52 \u001b[m\u001b[8Ccase "$opt" in\n\u001b[38;5;130m 53 \u001b[m\u001b[8Ch)\n\u001b[38;5;130m 54 \u001b[m\u001b[12Cusage\n\u001b[38;5;130m 55 \u001b[m\u001b[12C;;\n\u001b[38;5;130m 56 \u001b[m\u001b[8Cs)\u001b[1;9H\u001b[?25h\u001b[?25l\u001b[27m\u001b[29m\u001b[m\u001b[H\u001b[2J\u001b[1;1H\u001b[38;5;130m 58 \u001b[m\u001b[16C>&2 echo "Sleep interval (-s) must be a number"\n\u001b[38;5;130m 59 \u001b[m\u001b[16Cexit 1\n\u001b[38;5;130m 60 \u001b[m\u001b[12Cfi\n\u001b[38;5;130m 61 \u001b[m\u001b[12CARG_SLEEP_INTERVAL="$OPTARG"\n\u001b[38;5;130m 62 \u001b[m\u001b[12C;;\n\u001b[38;5;130m 63 \u001b[m\u001b[8Cw)\n\u001b[38;5;130m 64 \u001b[m\u001b[12Cif ! [[ $OPTARG =~ ^[0-9]+$ ]]; then\n\u001b[38;5;130m 65 \u001b[m\u001b[16C>&2 echo "Wait timeout (-w) must be a number"\n\u001b[38;5;130m 66 \u001b[m\u001b[16Cexit 1\n\u001b[38;5;130m 67 \u001b[m\u001b[12Cfi\n\u001b[38;5;130m 68 \u001b[m\u001b[12CARG_GRACE_PERIOD="$OPTARG"\n\u001b[38;5;130m 69 \u001b[m\u001b[12C;;\n\u001b[38;5;130m 70 \u001b[m\u001b[8Cx)\n\u001b[38;5;130m 71 \u001b[m\u001b[12CARG_KILL_IMMEDIATELY=1\n\u001b[38;5;130m 72 \u001b[m\u001b[12C;;\n\u001b[38;5;130m 73 \u001b[m\u001b[8Cesac\n\u001b[38;5;130m 74 \u001b[m done\n\u001b[38;5;130m 75 \n 76 \u001b[m GRACE_PERIOD=${ARG_GRACE_PERIOD:--1}\n\u001b[38;5;130m 77 \u001b[m SLEEP_INTERVAL=${ARG_SLEEP_INTERVAL:-30}\n\u001b[38;5;130m 78 \u001b[m KILL_IMMEDIATELY=${ARG_KILL_IMMEDIATELY:-0}\n\u001b[38;5;130m 79 \u001b[m}\n\u001b[38;5;130m 80 \n 81 \u001b[mDB_USER="rolap01"\n\u001b[38;5;130m 82 \n 83 \u001b[mparse_args $@\n', + }, + }, + }, + }, + + { + _index: 'logs-endpoint.events.process', + _id: '7', + _source: { + '@timestamp': '2022-07-14T11:16:35.570Z', + message: 'hello world security', + event: { + action: 'text_output', + }, + process: { + entity_id: '2', + name: 'vim', + executable: '/bin/vi', + entry_leader: { + entity_id: '1', + }, + io: { + type: 'tty', + total_bytes_captured: 1024, + total_bytes_skipped: 0, + bytes_skipped: [], + text: '\u001b[38;5;130m 84 \n 85 \u001b[mif [[ $KILL_IMMEDIATELY == 1 ]]; then\n\u001b[38;5;130m 86 \u001b[m echo "WARNING: Not waiting for connections to close gracefully"\n\u001b[38;5;130m 87 \u001b[m echo "Press any key to continue... wsrep_reject_queries will be set to \'ALL_KILL\'"\n\u001b[38;5;130m 88 \u001b[m read a\n\u001b[38;5;130m 89 \u001b[m mysql -h127.0.0.1 -P3306 -uroot -e "set global wsrep_reject_queries=\'ALL_KILL\'"\n\u001b[38;5;130m 90 \u001b[melse\n\u001b[38;5;130m 91 \u001b[m # Stop accepting queries in mariadb, do not kill opened connections\n\u001b[38;5;130m 92 \u001b[m mysql -h127.0.0.1 -P3306 -uroot -e "set global wsrep_reject_queries=\'ALL\'"\n\u001b[38;5;130m 93 \u001b[mfi\n\u001b[38;5;130m 94 \n 95 \u001b[mexit_code=$?\n\u001b[38;5;130m 96 \u001b[mif [[ $exit_code != 0 ]]; then\n\u001b[38;5;130m 97 \u001b[m >&2 echo "Failed to set the reject of queries on Galera node, exiting."\n\u001b[38;5;130m 98 \u001b[m exit $exit_code\n\u001b[38;5;130m 99 \u001b[melse\n\u001b[38;5;130m 100 \u001b[m echo "Successfully stopped accepting queries."\n\u001b[38;5;130m 101 \u001b[m if [[ $KILL_IMMEDIATELY == 1 ]]; then\n\u001b[38;5;130m 102 \u001b[m\u001b[8Cexit\n\u001b[38;5;130m 103 \u001b[m fi\n\u001b[38;5;130m 104 \u001b[mfi\n\u001b[38;5;130m 105 \n 106 \u001b[mif [[ $GRACE_PERIOD == -1 ]]; then\n\u001b[38;5;130m 107 \u001b[m set_number_grace_seconds\n\u001b[38;5;130m 108 \u001b[mfi\n\u001b[38;5;130m 109 \n 110 \u001b[mwait_for_connections\n\u001b[38;5;130m 111 \u001b[mif [[ $DB_CONNECTIONS_NUMBER != 0 ]]; then\n\u001b[38;5;130m 112 \u001b[m get_number_db_connections\n\u001b[38;5;130m 113 \u001b[m >&2 echo "ERROR: There are still $DB_CONNECTIONS_NUMBER opened DB connections."\n\u001b[38;5;130m 114 \u001b[m exit 3\n\u001b[38;5;130m 115 \u001b[mfi\b\b\u001b[?25h\u001b[?25l\nType :qa! and press to abandon all changes and exit Vim\u0007\u001b[58;9H\u001b[?25h\u0007\u001b[?25l\u001b[59;1H\u001b[K\u001b[59;1H:\u001b[?2004h\u001b[?25hqa!\r\u001b[?25l\u001b[?2004l\u001b[59;1H\u001b[K\u001b[59;1H\u001b[?2004l\u001b[?1l\u001b>\u001b[?25h\u001b[?1049l\u001b[23;0;0t,\u001bkroot@staging-host:~\u001b\\\n', + }, + }, + }, + }, + + { + _index: 'logs-endpoint.events.process', + _id: '8', + _source: { + '@timestamp': '2022-07-14T11:16:36.570Z', + message: 'hello world security', + event: { + action: 'text_output', + }, + process: { + entity_id: '1', + name: 'bash', + executable: '/bin/bash', + entry_leader: { + entity_id: '1', + }, + io: { + type: 'tty', + total_bytes_captured: 1024, + total_bytes_skipped: 0, + bytes_skipped: [], + text: '\u001bkroot@staging-host:~\u001b\\\b\b\b\b\u001b[1P\b\b\b\b\u001b[1P\b\b\b\b\u001b[1P\b\b\b\b\b\b\b\b\b\n\u001bkroot@staging-host:~\u001b\\\b\u001b[K\b\u001b[K\b\u001b[K\n,\n22/05/26 09:24:09 rack-na/cl_md (md), Cluster ********\n[root@staging-host:~] vi -R /usr/local/bin/galera_traffic_start.sh\u0007\n22/05/26 09:25:32 rack-na/cl_md (md), Cluster ********\n[root@staging-host:~] vi -R /usr/local/bin/galera_traffic_start.sh.sh.sh.sho.shp.sh\n22/05/26 09:30:08 rack-na/cl_md (md), Cluster ********\n[root@staging-host:~] exi\u0007\u0007\u0007exitlogout\n,\u001bec2-user@staging-host:~\u001b\\\n\u001bec2-user@staging-host:~\u001b\\\n,\n22/05/26 09:24:01 rack-na/cl_md (md), Cluster ********\n[ec2-user@staging-host:~] sudo -i\n22/05/26 10:11:37 rack-na/cl_md (md), Cluster ********\n[ec2-user@staging-host:~] exitlogout\n\n', + }, + }, + }, + }, + ], +}; diff --git a/x-pack/plugins/session_view/common/types/process_tree/index.ts b/x-pack/plugins/session_view/common/types/process_tree/index.ts index 04c82e5e9c48d..e620b654db16f 100644 --- a/x-pack/plugins/session_view/common/types/process_tree/index.ts +++ b/x-pack/plugins/session_view/common/types/process_tree/index.ts @@ -21,7 +21,7 @@ export const enum EventAction { fork = 'fork', exec = 'exec', end = 'end', - output = 'output', + text_output = 'text_output', } export interface User { @@ -62,6 +62,20 @@ export interface Teletype { }; } +// used by tty_player component to split process.io.text into lines of IO +export interface IOLine { + value?: string; + + // the following is only set client side for caching purposes + process_name?: string; + process_entity_id?: string; + process_entity_cursor?: string; +} + +export interface IOFields { + text?: string; +} + export interface ProcessFields { entity_id?: string; args?: string[]; @@ -91,6 +105,7 @@ export interface ProcessSelf extends ProcessFields { session_leader?: ProcessFields; entry_leader?: ProcessFields; group_leader?: ProcessFields; + io?: IOFields; } export interface ProcessEventHost { @@ -209,15 +224,15 @@ export interface ProcessEventOrchestrator { name?: string; type?: string; ip?: string; + parent?: { + type?: string; + }; }; namespace?: string; cluster?: { name?: string; id?: string; }; - parent?: { - type?: string; - }; } export interface ProcessEventCloud { diff --git a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.test.ts b/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.test.ts index 61d9a7fb0f6b3..e54bde34fb2f0 100644 --- a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.test.ts +++ b/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.test.ts @@ -47,15 +47,15 @@ const MOCK_ORCHESTRATOR_DATA: ProcessEventOrchestrator = { name: 'pdcsi-node-6hvsp', type: 'pod', ip: 'PLACEHOLDER_FOR_RESOURCE.IP', + parent: { + type: 'PLACEHOLDER_FOR_RESOURCE.PARENT.TYPE', + }, }, namespace: 'kube-system', cluster: { name: 'elastic-k8s-cluster', id: 'PLACEHOLDER_FOR_CLUSTER.ID', }, - parent: { - type: 'PLACEHOLDER_FOR_PARENT.TYPE', - }, }; const MOCK_CLOUD_DATA: ProcessEventCloud = { @@ -164,15 +164,15 @@ describe('detail panel host tab helpers tests', () => { name: undefined, type: 'pod', ip: undefined, + parent: { + type: 'PLACEHOLDER_FOR_RESOURCE.PARENT.TYPE', + }, }, namespace: 'kube-system', cluster: { name: 'elastic-k8s-cluster', id: undefined, }, - parent: { - type: 'PLACEHOLDER_FOR_PARENT.TYPE', - }, }); expect(result.resource.name).toEqual(DASH); expect(result.resource.type).toEqual(MOCK_ORCHESTRATOR_DATA?.resource?.type); @@ -180,7 +180,7 @@ describe('detail panel host tab helpers tests', () => { expect(result.namespace).toEqual(MOCK_ORCHESTRATOR_DATA?.namespace); expect(result.cluster.name).toEqual(MOCK_ORCHESTRATOR_DATA?.cluster?.name); expect(result.cluster.id).toEqual(DASH); - expect(result.parent.type).toEqual(MOCK_ORCHESTRATOR_DATA?.parent?.type); + expect(result.resource.parent.type).toEqual(MOCK_ORCHESTRATOR_DATA?.resource?.parent?.type); }); it('getOchestratorData returns all data provided', () => { @@ -191,7 +191,7 @@ describe('detail panel host tab helpers tests', () => { expect(result.namespace).toEqual(MOCK_ORCHESTRATOR_DATA?.namespace); expect(result.cluster.name).toEqual(MOCK_ORCHESTRATOR_DATA?.cluster?.name); expect(result.cluster.id).toEqual(MOCK_ORCHESTRATOR_DATA?.cluster?.id); - expect(result.parent.type).toEqual(MOCK_ORCHESTRATOR_DATA?.parent?.type); + expect(result.resource.parent.type).toEqual(MOCK_ORCHESTRATOR_DATA?.resource?.parent?.type); }); it('getCloudData returns dashes for missing fields', () => { diff --git a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.ts b/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.ts index 7254f57cc93c6..f4da70e5927bc 100644 --- a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.ts +++ b/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.ts @@ -94,15 +94,15 @@ export const getOrchestratorData = ( name: DASH, type: DASH, ip: DASH, + parent: { + type: DASH, + }, }, namespace: DASH, cluster: { name: DASH, id: DASH, }, - parent: { - type: DASH, - }, }; if (!orchestrator) { @@ -115,7 +115,9 @@ export const getOrchestratorData = ( detailPanelOrchestrator.namespace = dataOrDash(orchestrator?.namespace).toString(); detailPanelOrchestrator.cluster.name = dataOrDash(orchestrator?.cluster?.name).toString(); detailPanelOrchestrator.cluster.id = dataOrDash(orchestrator?.cluster?.id).toString(); - detailPanelOrchestrator.parent.type = dataOrDash(orchestrator?.parent?.type).toString(); + detailPanelOrchestrator.resource.parent.type = dataOrDash( + orchestrator?.resource?.parent?.type + ).toString(); return detailPanelOrchestrator; }; diff --git a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/index.test.tsx b/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/index.test.tsx index 6fce4f3f33a13..ba530805c80dc 100644 --- a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/index.test.tsx +++ b/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/index.test.tsx @@ -41,9 +41,9 @@ const TEST_ORCHESTRATOR_RESOURCE_NAME = 'pdcsi-node-6hvsp'; const TEST_ORCHESTRATOR_RESOURCE_TYPE = 'pod'; const TEST_ORCHESTRATOR_RESOURCE_IP = 'PLACEHOLDER_FOR_RESOURCE.IP'; const TEST_ORCHESTRATOR_NAMESPACE = 'kube-system'; -const TEST_ORCHESTRATOR_PARENT_TYPE = 'elastic-k8s-cluster'; +const TEST_ORCHESTRATOR_RESOURCE_PARENT_TYPE = 'elastic-k8s-cluster'; const TEST_ORCHESTRATOR_CLUSTER_ID = 'PLACEHOLDER_FOR_CLUSTER.ID'; -const TEST_ORCHESTRATOR_CLUSTER_NAME = 'PLACEHOLDER_FOR_PARENT.TYPE'; +const TEST_ORCHESTRATOR_CLUSTER_NAME = 'PLACEHOLDER_FOR_CLUSTER.NAME'; // Cloud data const TEST_CLOUD_INSTANCE_NAME = 'gke-cluster-1-paulo-default-pool-f0fea4ab-lhx2'; @@ -86,15 +86,15 @@ const TEST_ORCHESTRATOR: ProcessEventOrchestrator = { name: TEST_ORCHESTRATOR_RESOURCE_NAME, type: TEST_ORCHESTRATOR_RESOURCE_TYPE, ip: TEST_ORCHESTRATOR_RESOURCE_IP, + parent: { + type: TEST_ORCHESTRATOR_RESOURCE_PARENT_TYPE, + }, }, namespace: TEST_ORCHESTRATOR_NAMESPACE, cluster: { name: TEST_ORCHESTRATOR_CLUSTER_NAME, id: TEST_ORCHESTRATOR_CLUSTER_ID, }, - parent: { - type: TEST_ORCHESTRATOR_PARENT_TYPE, - }, }; const TEST_CLOUD: ProcessEventCloud = { @@ -215,14 +215,14 @@ describe('DetailPanelMetadataTab component', () => { expect(renderResult.queryByText('resource.type')).toBeVisible(); expect(renderResult.queryByText('resource.ip')).toBeVisible(); expect(renderResult.queryByText('namespace')).toBeVisible(); - expect(renderResult.queryByText('parent.type')).toBeVisible(); + expect(renderResult.queryByText('resource.parent.type')).toBeVisible(); expect(renderResult.queryByText('cluster.id')).toBeVisible(); expect(renderResult.queryByText('cluster.name')).toBeVisible(); expect(renderResult.queryByText(TEST_ORCHESTRATOR_RESOURCE_NAME)).toBeVisible(); expect(renderResult.queryByText(TEST_ORCHESTRATOR_RESOURCE_TYPE)).toBeVisible(); expect(renderResult.queryByText(TEST_ORCHESTRATOR_RESOURCE_IP)).toBeVisible(); expect(renderResult.queryByText(TEST_ORCHESTRATOR_NAMESPACE)).toBeVisible(); - expect(renderResult.queryByText(TEST_ORCHESTRATOR_PARENT_TYPE)).toBeVisible(); + expect(renderResult.queryByText(TEST_ORCHESTRATOR_RESOURCE_PARENT_TYPE)).toBeVisible(); expect(renderResult.queryByText(TEST_ORCHESTRATOR_CLUSTER_ID)).toBeVisible(); expect(renderResult.queryByText(TEST_ORCHESTRATOR_CLUSTER_NAME)).toBeVisible(); diff --git a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/index.tsx b/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/index.tsx index 77a2324bddfc5..797f6c725dfb6 100644 --- a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/index.tsx +++ b/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/index.tsx @@ -433,6 +433,19 @@ export const DetailPanelMetadataTab = ({ ), }, + { + title: resource.parent.type, + description: ( + + + {orchestratorData.resource.parent.type} + + + ), + }, { title: namespace, description: ( @@ -472,19 +485,6 @@ export const DetailPanelMetadataTab = ({ ), }, - { - title: parent.type, - description: ( - - - {orchestratorData.parent.type} - - - ), - }, ]} /> diff --git a/x-pack/plugins/session_view/public/components/process_tree/hooks.ts b/x-pack/plugins/session_view/public/components/process_tree/hooks.ts index 3b33db65f8274..5369e6a3f2827 100644 --- a/x-pack/plugins/session_view/public/components/process_tree/hooks.ts +++ b/x-pack/plugins/session_view/public/components/process_tree/hooks.ts @@ -140,7 +140,7 @@ export class ProcessImpl implements Process { } hasOutput() { - return !!this.findEventByAction(this.events, EventAction.output); + return !!this.findEventByAction(this.events, EventAction.text_output); } hasAlerts() { diff --git a/x-pack/plugins/session_view/public/components/session_view/hooks.ts b/x-pack/plugins/session_view/public/components/session_view/hooks.ts index f695fb0d3a871..06a1e0125aea1 100644 --- a/x-pack/plugins/session_view/public/components/session_view/hooks.ts +++ b/x-pack/plugins/session_view/public/components/session_view/hooks.ts @@ -5,7 +5,7 @@ * 2.0. */ import { useEffect, useState, useMemo } from 'react'; -import { useQuery, useInfiniteQuery } from 'react-query'; +import { useQuery, useInfiniteQuery } from '@tanstack/react-query'; import { EuiSearchBarOnChangeArgs } from '@elastic/eui'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; @@ -20,8 +20,10 @@ import { PROCESS_EVENTS_PER_PAGE, ALERTS_PER_PAGE, ALERT_STATUS_ROUTE, + GET_TOTAL_IO_BYTES_ROUTE, QUERY_KEY_PROCESS_EVENTS, QUERY_KEY_ALERTS, + QUERY_KEY_GET_TOTAL_IO_BYTES, } from '../../../common/constants'; export const useFetchSessionViewProcessEvents = ( @@ -187,6 +189,30 @@ export const useFetchAlertStatus = ( return query; }; +// TODO: we should not load by session id, but instead a combo of process.tty.major+minor, session time range, and host.boot_id (see Rabbitholes section of epic). +export const useFetchGetTotalIOBytes = (sessionEntityId: string) => { + const { http } = useKibana().services; + const cachingKeys = [QUERY_KEY_GET_TOTAL_IO_BYTES, sessionEntityId]; + const query = useQuery( + cachingKeys, + async () => { + return http.get(GET_TOTAL_IO_BYTES_ROUTE, { + query: { + sessionEntityId, + }, + }); + }, + { + refetchOnWindowFocus: false, + refetchOnMount: false, + refetchOnReconnect: false, + cacheTime: 0, + } + ); + + return query; +}; + export const useSearchQuery = () => { const [searchQuery, setSearchQuery] = useState(''); const onSearch = ({ query }: EuiSearchBarOnChangeArgs) => { diff --git a/x-pack/plugins/session_view/public/components/session_view/index.test.tsx b/x-pack/plugins/session_view/public/components/session_view/index.test.tsx index 159a3782be259..215fa55747098 100644 --- a/x-pack/plugins/session_view/public/components/session_view/index.test.tsx +++ b/x-pack/plugins/session_view/public/components/session_view/index.test.tsx @@ -12,6 +12,7 @@ import { AppContextTestRender, createAppRootMockRenderer } from '../../test'; import { SessionView } from '.'; import userEvent from '@testing-library/user-event'; import { useDateFormat } from '../../hooks'; +import { GET_TOTAL_IO_BYTES_ROUTE, PROCESS_EVENTS_ROUTE } from '../../../common/constants'; jest.mock('../../hooks/use_date_format'); const mockUseDateFormat = useDateFormat as jest.Mock; @@ -22,8 +23,6 @@ describe('SessionView component', () => { let mockedContext: AppContextTestRender; let mockedApi: AppContextTestRender['coreStart']['http']['get']; - const waitForApiCall = () => waitFor(() => expect(mockedApi).toHaveBeenCalled()); - beforeEach(() => { mockedContext = createAppRootMockRenderer(); mockedApi = mockedContext.coreStart.http.get; @@ -46,10 +45,11 @@ describe('SessionView component', () => { // make the request wait mockedApi.mockReturnValue(new Promise((resolve) => (releaseApiResponse = resolve))); render(); - await waitForApiCall(); // see if loader is present - expect(renderResult.getByTestId('sectionLoading')).toBeTruthy(); + await waitFor(() => { + expect(renderResult.getByTestId('sectionLoading')).toBeTruthy(); + }); // release the request releaseApiResponse!(mockedApi); @@ -60,13 +60,15 @@ describe('SessionView component', () => { it('should show the Empty message', async () => { render(); - await waitForApiCall(); - expect(renderResult.getByTestId('sessionView:sessionViewProcessEventsEmpty')).toBeTruthy(); + await waitFor(() => { + expect( + renderResult.getByTestId('sessionView:sessionViewProcessEventsEmpty') + ).toBeTruthy(); + }); }); it('should not display the search bar', async () => { render(); - await waitForApiCall(); expect( renderResult.queryByTestId('sessionView:sessionViewProcessEventsSearch') ).toBeFalsy(); @@ -84,10 +86,11 @@ describe('SessionView component', () => { // make the request wait mockedApi.mockReturnValue(new Promise((resolve) => (releaseApiResponse = resolve))); render(); - await waitForApiCall(); // see if loader is present - expect(renderResult.getByTestId('sectionLoading')).toBeTruthy(); + await waitFor(() => { + expect(renderResult.getByTestId('sectionLoading')).toBeTruthy(); + }); // release the request releaseApiResponse!(mockedApi); @@ -98,20 +101,28 @@ describe('SessionView component', () => { it('should display the search bar', async () => { render(); - await waitForApiCall(); - expect(renderResult.getByTestId('sessionView:sessionViewProcessEventsSearch')).toBeTruthy(); + + await waitFor(() => { + expect( + renderResult.getByTestId('sessionView:sessionViewProcessEventsSearch') + ).toBeTruthy(); + }); }); it('should show items on the list, and auto selects session leader', async () => { render(); - await waitForApiCall(); - expect(renderResult.getAllByTestId('sessionView:processTreeNode')).toBeTruthy(); + await waitFor(() => { + expect(renderResult.getAllByTestId('sessionView:processTreeNode')).toBeTruthy(); + }); }); it('should toggle detail panel visibilty when detail button clicked', async () => { render(); - await waitForApiCall(); + + await waitFor(() => { + expect(renderResult.getByTestId('sessionView:sessionViewDetailPanelToggle')).toBeTruthy(); + }); userEvent.click(renderResult.getByTestId('sessionView:sessionViewDetailPanelToggle')); expect(renderResult.getByText('Process')).toBeTruthy(); @@ -121,7 +132,11 @@ describe('SessionView component', () => { it('should render session view options button and its options when clicked', async () => { render(); - await waitForApiCall(); + + await waitFor(() => { + expect(renderResult.getByTestId('sessionView:sessionViewOptionButton')).toBeTruthy(); + }); + userEvent.click(renderResult.getByTestId('sessionView:sessionViewOptionButton')); expect(renderResult.getByText('Display options')).toBeTruthy(); expect(renderResult.getByText('Timestamp')).toBeTruthy(); @@ -130,9 +145,52 @@ describe('SessionView component', () => { it('should show refresh button', async () => { render(); - await waitForApiCall(); - expect(renderResult.getAllByTestId('sessionView:sessionViewRefreshButton')).toBeTruthy(); + await waitFor(() => { + expect(renderResult.getAllByTestId('sessionView:sessionViewRefreshButton')).toBeTruthy(); + }); + }); + }); + + describe('TTYPlayer button', () => { + it('should show tty player button, if session has output', async () => { + mockedApi.mockImplementation(async (path: any) => { + if (path === PROCESS_EVENTS_ROUTE) { + return sessionViewProcessEventsMock; + } else if (path === GET_TOTAL_IO_BYTES_ROUTE) { + return 1024; + } + + return 0; + }); + + render(); + + await waitFor(() => { + expect(renderResult.queryByTestId('sessionView:TTYPlayerToggle')).toBeTruthy(); + }); + }); + + it('should NOT show tty player button, if session has no output', async () => { + mockedApi.mockImplementation(async (options) => { + // for some reason the typescript interface for options says its an object with a field called path. + // in reality options is a string (which equals the path...) + const path = String(options); + + if (path === PROCESS_EVENTS_ROUTE) { + return sessionViewProcessEventsMock; + } else if (path === GET_TOTAL_IO_BYTES_ROUTE) { + return 0; + } + + return 0; + }); + + render(); + + await waitFor(() => { + expect(renderResult.queryByTestId('sessionView:TTYPlayerToggle')).toBeFalsy(); + }); }); }); }); diff --git a/x-pack/plugins/session_view/public/components/session_view/index.tsx b/x-pack/plugins/session_view/public/components/session_view/index.tsx index 1c099e056df88..e2d795283c7ce 100644 --- a/x-pack/plugins/session_view/public/components/session_view/index.tsx +++ b/x-pack/plugins/session_view/public/components/session_view/index.tsx @@ -16,7 +16,6 @@ import { EuiBetaBadge, EuiButtonIcon, } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import useLocalStorage from 'react-use/lib/useLocalStorage'; import { SectionLoading } from '../../shared_imports'; @@ -31,17 +30,16 @@ import { SessionViewDeps } from '../../types'; import { SessionViewDetailPanel } from '../session_view_detail_panel'; import { SessionViewSearchBar } from '../session_view_search_bar'; import { SessionViewDisplayOptions } from '../session_view_display_options'; +import { TTYPlayer } from '../tty_player'; import { useStyles } from './styles'; import { useFetchAlertStatus, useFetchSessionViewProcessEvents, useFetchSessionViewAlerts, + useFetchGetTotalIOBytes, } from './hooks'; import { LOCAL_STORAGE_DISPLAY_OPTIONS_KEY } from '../../../common/constants'; - -const BETA = i18n.translate('xpack.sessionView.beta', { - defaultMessage: 'Beta', -}); +import { BETA, REFRESH_SESSION, OPEN_TTY_PLAYER } from './translations'; /** * The main wrapper component for the session view. @@ -61,6 +59,7 @@ export const SessionView = ({ jumpToCursor = undefined; } + const [showTTY, setShowTTY] = useState(false); const [isDetailOpen, setIsDetailOpen] = useState(false); const [selectedProcess, setSelectedProcess] = useState(null); const [searchQuery, setSearchQuery] = useState(''); @@ -86,6 +85,10 @@ export const SessionView = ({ return !!(!displayOptions?.verboseMode && searchQuery && searchResults?.length === 0); }, [displayOptions?.verboseMode, searchResults, searchQuery]); + const onToggleTTY = useCallback(() => { + setShowTTY(!showTTY); + }, [showTTY]); + const onProcessSelected = useCallback((process: Process | null) => { setSelectedProcess(process); }, []); @@ -159,6 +162,9 @@ export const SessionView = ({ fetchAlertStatus[0] ?? '' ); + const { data: totalTTYOutputBytes } = useFetchGetTotalIOBytes(sessionEntityId); + const hasTTYOutput = !!totalTTYOutputBytes; + useEffect(() => { if (newUpdatedAlertsStatus) { setUpdatedAlertsStatus({ ...newUpdatedAlertsStatus }); @@ -167,6 +173,19 @@ export const SessionView = ({ } }, [newUpdatedAlertsStatus, fetchAlertStatus]); + const onSearchIndexChange = useCallback( + (index: number) => { + if (searchResults) { + const process = searchResults[index]; + + if (process) { + onProcessSelected(process); + } + } + }, + [onProcessSelected, searchResults] + ); + const handleOnAlertDetailsClosed = useCallback((alertUuid: string) => { setFetchAlertStatus([alertUuid]); }, []); @@ -228,142 +247,162 @@ export const SessionView = ({ } return ( - <> -
- - - - - - - - +
+ + + + + + + + + + + + + {hasTTYOutput && ( + )} - - + + + + + + - + + + + + + + {(EuiResizablePanel, EuiResizableButton, { togglePanel }) => { + detailPanelCollapseFn.current = () => { + togglePanel?.('session-detail-panel', { direction: 'left' }); + }; - - + + {hasError && ( + + + + } + body={ +

+ +

+ } + /> + )} + + {hasData && ( +
+ +
+ )} +
+ + + - -
-
- - - - - {(EuiResizablePanel, EuiResizableButton, { togglePanel }) => { - detailPanelCollapseFn.current = () => { - togglePanel?.('session-detail-panel', { direction: 'left' }); - }; - - return ( - <> - - {hasError && ( - - - - } - body={ -

- -

- } - /> - )} - - {hasData && ( -
- -
- )} -
- - - - - - - ); - }} -
-
- + + + ); + }} + + {showTTY && ( + + )} +
); }; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/plugins/session_view/public/components/session_view/styles.ts b/x-pack/plugins/session_view/public/components/session_view/styles.ts index 0b05f3b9d9c9b..c532ef1371b40 100644 --- a/x-pack/plugins/session_view/public/components/session_view/styles.ts +++ b/x-pack/plugins/session_view/public/components/session_view/styles.ts @@ -46,6 +46,7 @@ export const useStyles = ({ height = 500, isFullScreen }: StylesDeps) => { }; const sessionViewerComponent: CSSObject = { + position: 'relative', border: border.thin, borderRadius: border.radius.medium, '.sessionViewerToolbar': { diff --git a/x-pack/plugins/session_view/public/components/session_view/translations.ts b/x-pack/plugins/session_view/public/components/session_view/translations.ts new file mode 100644 index 0000000000000..244a5a355b0ec --- /dev/null +++ b/x-pack/plugins/session_view/public/components/session_view/translations.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 { i18n } from '@kbn/i18n'; + +export const BETA = i18n.translate('xpack.sessionView.beta', { + defaultMessage: 'Beta', +}); + +export const REFRESH_SESSION = i18n.translate('xpack.sessionView.refreshSession', { + defaultMessage: 'Refresh session', +}); + +export const OPEN_TTY_PLAYER = i18n.translate('xpack.sessionView.openTTYPlayer', { + defaultMessage: 'Open TTY player', +}); diff --git a/x-pack/plugins/session_view/public/components/session_view_search_bar/index.test.tsx b/x-pack/plugins/session_view/public/components/session_view_search_bar/index.test.tsx index dd758529530ba..8b3498f2a11b8 100644 --- a/x-pack/plugins/session_view/public/components/session_view_search_bar/index.test.tsx +++ b/x-pack/plugins/session_view/public/components/session_view_search_bar/index.test.tsx @@ -16,23 +16,28 @@ describe('SessionViewSearchBar component', () => { let render: () => ReturnType; let renderResult: ReturnType; let mockedContext: AppContextTestRender; + let props = { + searchQuery: 'ls', + totalMatches: 0, + onNext: jest.fn((query) => query), + onPrevious: jest.fn((query) => query), + setSearchQuery: jest.fn((query) => query), + }; beforeEach(() => { mockedContext = createAppRootMockRenderer(); + + props = { + searchQuery: 'ls', + totalMatches: 0, + onNext: jest.fn((query) => query), + onPrevious: jest.fn((query) => query), + setSearchQuery: jest.fn((query) => query), + }; }); it('handles a typed search query', async () => { - const mockSetSearchQuery = jest.fn((query) => query); - const mockOnProcessSelected = jest.fn((process) => process); - - renderResult = mockedContext.render( - - ); + renderResult = mockedContext.render(); const searchInput = renderResult.getByTestId('sessionView:searchBar').querySelector('input'); @@ -44,24 +49,17 @@ describe('SessionViewSearchBar component', () => { } expect(searchInput?.value).toEqual('ls -la'); - expect(mockSetSearchQuery.mock.calls.length).toBe(1); - expect(mockSetSearchQuery.mock.results[0].value).toBe('ls -la'); + expect(props.setSearchQuery.mock.calls.length).toBe(1); + expect(props.setSearchQuery.mock.results[0].value).toBe('ls -la'); }); it('shows a results navigator when searchResults provided', async () => { const processMock2 = { ...processMock }; const processMock3 = { ...processMock }; const mockResults = [processMock, processMock2, processMock3]; - const mockSetSearchQuery = jest.fn((query) => query); - const mockOnProcessSelected = jest.fn((process) => process); renderResult = mockedContext.render( - + ); const searchPagination = renderResult.getByTestId('sessionView:searchPagination'); @@ -73,6 +71,16 @@ describe('SessionViewSearchBar component', () => { userEvent.click(renderResult.getByTestId('pagination-button-next')); expect(searchPagination.querySelector(paginationTextClass)?.textContent).toEqual('2 of 3'); + userEvent.click(renderResult.getByTestId('pagination-button-next')); + expect(searchPagination.querySelector(paginationTextClass)?.textContent).toEqual('3 of 3'); + + // ensure clicking next after we reach the end doesn't cause a 4 of 3 situation. + userEvent.click(renderResult.getByTestId('pagination-button-next')); + expect(searchPagination.querySelector(paginationTextClass)?.textContent).toEqual('3 of 3'); + + userEvent.click(renderResult.getByTestId('pagination-button-previous')); + expect(searchPagination.querySelector(paginationTextClass)?.textContent).toEqual('2 of 3'); + const searchInput = renderResult.getByTestId('sessionView:searchBar').querySelector('input'); if (searchInput) { @@ -83,13 +91,8 @@ describe('SessionViewSearchBar component', () => { // after search is changed, results index should reset to 1 expect(searchPagination.querySelector(paginationTextClass)?.textContent).toEqual('1 of 3'); - // setSelectedProcess should be called 3 times: - // 1. searchResults is set so auto select first item - // 2. next button hit, so call with 2nd item - // 3. search changed, so call with first result. - expect(mockOnProcessSelected.mock.calls.length).toBe(3); - expect(mockOnProcessSelected.mock.results[0].value).toEqual(processMock); - expect(mockOnProcessSelected.mock.results[1].value).toEqual(processMock2); - expect(mockOnProcessSelected.mock.results[1].value).toEqual(processMock); + expect(props.onNext.mock.calls.length).toBe(2); + expect(props.onPrevious.mock.calls.length).toBe(1); + expect(props.onPrevious.mock.results[0].value).toEqual(1); // e.g 2 of 3, 1 because index is zero based. }); }); diff --git a/x-pack/plugins/session_view/public/components/session_view_search_bar/index.tsx b/x-pack/plugins/session_view/public/components/session_view_search_bar/index.tsx index 0cac43f39a8ec..3fa7bcaf5d829 100644 --- a/x-pack/plugins/session_view/public/components/session_view_search_bar/index.tsx +++ b/x-pack/plugins/session_view/public/components/session_view_search_bar/index.tsx @@ -4,18 +4,18 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { useState, useEffect } from 'react'; +import React, { useState, useCallback } from 'react'; import { EuiSearchBar, EuiPagination } from '@elastic/eui'; import { EuiSearchBarOnChangeArgs } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { Process } from '../../../common/types/process_tree'; import { useStyles } from './styles'; interface SessionViewSearchBarDeps { searchQuery: string; setSearchQuery(val: string): void; - searchResults: Process[] | null; - onProcessSelected(process: Process): void; + totalMatches: number; + onPrevious: (index: number) => void; + onNext: (index: number) => void; } const translatePlaceholder = { @@ -34,11 +34,12 @@ const NO_RESULTS = i18n.translate('xpack.sessionView.searchBar.searchBarNoResult export const SessionViewSearchBar = ({ searchQuery, setSearchQuery, - onProcessSelected, - searchResults, + totalMatches, + onPrevious, + onNext, }: SessionViewSearchBarDeps) => { - const showPagination = !!searchQuery && searchResults?.length !== 0; - const noResults = !!searchQuery && searchResults?.length === 0; + const showPagination = !!searchQuery && totalMatches !== 0; + const noResults = !!searchQuery && totalMatches === 0; const styles = useStyles({ hasSearchResults: showPagination }); @@ -54,15 +55,18 @@ export const SessionViewSearchBar = ({ } }; - useEffect(() => { - if (searchResults) { - const process = searchResults[selectedResult]; + const onPageClick = useCallback( + (page: number) => { + setSelectedResult(page); - if (process) { - onProcessSelected(process); + if (page > selectedResult) { + onNext(page); + } else { + onPrevious(page); } - } - }, [searchResults, onProcessSelected, selectedResult]); + }, + [onNext, onPrevious, selectedResult] + ); return (
@@ -72,9 +76,9 @@ export const SessionViewSearchBar = ({ )} diff --git a/x-pack/plugins/session_view/public/components/tty_player/hooks.test.tsx b/x-pack/plugins/session_view/public/components/tty_player/hooks.test.tsx new file mode 100644 index 0000000000000..23f81d7941439 --- /dev/null +++ b/x-pack/plugins/session_view/public/components/tty_player/hooks.test.tsx @@ -0,0 +1,174 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { renderHook, act } from '@testing-library/react-hooks'; +import { sessionViewIOEventsMock } from '../../../common/mocks/responses/session_view_io_events.mock'; +import { useIOLines, useXtermPlayer, XtermPlayerDeps } from './hooks'; +import { ProcessEventsPage } from '../../../common/types/process_tree'; +import { DEFAULT_TTY_PLAYSPEED_MS } from '../../../common/constants'; + +describe('TTYPlayer/hooks', () => { + beforeAll(() => { + // https://stackoverflow.com/questions/39830580/jest-test-fails-typeerror-window-matchmedia-is-not-a-function + // xtermjs is using window.matchMedia, which isn't mocked in jest by default. + Object.defineProperty(window, 'matchMedia', { + writable: true, + value: jest.fn().mockImplementation((query) => ({ + matches: false, + media: query, + onchange: null, + addListener: jest.fn(), // Deprecated + removeListener: jest.fn(), // Deprecated + addEventListener: jest.fn(), + removeEventListener: jest.fn(), + dispatchEvent: jest.fn(), + })), + }); + + jest.useFakeTimers(); + }); + + describe('useIOLines', () => { + it('returns an array of "best effort" lines of tty output', async () => { + const events = sessionViewIOEventsMock?.events?.map((event) => event._source); + const initial: ProcessEventsPage[] = [{ events, total: events?.length }]; + + const { result, rerender } = renderHook(({ pages }) => useIOLines(pages), { + initialProps: { pages: initial }, + }); + + expect(result.current.length).toBeGreaterThan(0); + expect(typeof result.current[0].value).toBe('string'); + + // test memoization + let last = result.current; + rerender(); + expect(result.current === last).toBeTruthy(); + last = result.current; + rerender({ pages: [...initial] }); + expect(result.current === last).toBeFalsy(); + }); + }); + + describe('useXtermPlayer', () => { + let initialProps: XtermPlayerDeps; + + beforeEach(() => { + const events = sessionViewIOEventsMock?.events?.map((event) => event._source); + const pages: ProcessEventsPage[] = [{ events, total: events?.length }]; + const { result } = renderHook(() => useIOLines(pages)); + const lines = result.current; + const div = document.createElement('div'); + const mockRef = { current: div }; + initialProps = { + ref: mockRef, + isPlaying: false, + lines, + hasNextPage: false, + fetchNextPage: () => null, + isFullscreen: false, + }; + }); + + it('mounts and renders the first line of output', async () => { + const { result: xTermResult } = renderHook((props) => useXtermPlayer(props), { + initialProps, + }); + + const { terminal, currentLine, seekToLine } = xTermResult.current; + + // there is a minor delay in updates to xtermjs after writeln is called. + jest.advanceTimersByTime(100); + + // check that first line rendered in xtermjs + expect(terminal.buffer.active.getLine(0)?.translateToString(true)).toBe('256'); + expect(currentLine).toBe(0); + + act(() => { + seekToLine(17); // line where vim output starts + }); + + jest.advanceTimersByTime(100); + + expect(terminal.buffer.active.getLine(0)?.translateToString(true)).toBe('#!/bin/env bash'); + }); + + it('allows the user to seek to any line of output', async () => { + const { result: xTermResult } = renderHook((props) => useXtermPlayer(props), { + initialProps, + }); + + act(() => { + xTermResult.current.seekToLine(17); // line where vim output starts + }); + + jest.advanceTimersByTime(100); + + const { terminal, currentLine } = xTermResult.current; + + expect(currentLine).toBe(17); + expect(terminal.buffer.active.getLine(0)?.translateToString(true)).toBe('#!/bin/env bash'); + }); + + it('allows the user to play', async () => { + const { result, rerender } = renderHook((props) => useXtermPlayer(props), { + initialProps, + }); + + rerender({ ...initialProps, isPlaying: true }); + + act(() => { + jest.advanceTimersByTime(DEFAULT_TTY_PLAYSPEED_MS * 10); + }); + + expect(result.current.currentLine).toBe(10); + }); + + it('allows the user to stop', async () => { + const { result, rerender } = renderHook((props) => useXtermPlayer(props), { + initialProps, + }); + + rerender({ ...initialProps, isPlaying: true }); + act(() => { + jest.advanceTimersByTime(DEFAULT_TTY_PLAYSPEED_MS * 10); + }); + rerender({ ...initialProps, isPlaying: false }); + act(() => { + jest.advanceTimersByTime(DEFAULT_TTY_PLAYSPEED_MS * 10); + }); + expect(result.current.currentLine).toBe(10); // should still be ten. + }); + + it('should stop when it reaches the end of the array of lines', async () => { + const { result, rerender } = renderHook((props) => useXtermPlayer(props), { + initialProps, + }); + + rerender({ ...initialProps, isPlaying: true }); + act(() => { + jest.advanceTimersByTime(DEFAULT_TTY_PLAYSPEED_MS * initialProps.lines.length + 100); + }); + expect(result.current.currentLine).toBe(initialProps.lines.length); + }); + + it('will allow a plain text search highlight on the last line printed', async () => { + const { result: xTermResult } = renderHook((props) => useXtermPlayer(props), { + initialProps, + }); + + jest.advanceTimersByTime(100); + + act(() => { + xTermResult.current.search('256', 0); + }); + + const { terminal } = xTermResult.current; + + expect(terminal.getSelection()).toBe('256'); + }); + }); +}); diff --git a/x-pack/plugins/session_view/public/components/tty_player/hooks.ts b/x-pack/plugins/session_view/public/components/tty_player/hooks.ts new file mode 100644 index 0000000000000..e122a2dbd0c11 --- /dev/null +++ b/x-pack/plugins/session_view/public/components/tty_player/hooks.ts @@ -0,0 +1,230 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { Terminal } from 'xterm'; +import 'xterm/css/xterm.css'; +import { FitAddon } from 'xterm-addon-fit'; +import { useMemo, useState, useEffect, useCallback } from 'react'; +import { useInfiniteQuery } from '@tanstack/react-query'; +import { CoreStart } from '@kbn/core/public'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { SearchAddon } from './xterm_search'; +import { useEuiTheme } from '../../hooks'; +import { + IOLine, + ProcessEvent, + ProcessEventResults, + ProcessEventsPage, +} from '../../../common/types/process_tree'; +import { + IO_EVENTS_ROUTE, + IO_EVENTS_PER_PAGE, + QUERY_KEY_IO_EVENTS, + DEFAULT_TTY_PLAYSPEED_MS, +} from '../../../common/constants'; + +export const useFetchIOEvents = (sessionEntityId: string) => { + const { http } = useKibana().services; + const cachingKeys = useMemo(() => [QUERY_KEY_IO_EVENTS, sessionEntityId], [sessionEntityId]); + + const query = useInfiniteQuery( + cachingKeys, + async ({ pageParam = {} }) => { + const { cursor } = pageParam; + const res = await http.get(IO_EVENTS_ROUTE, { + query: { + sessionEntityId, + cursor, + }, + }); + + const events = res.events?.map((event: any) => event._source as ProcessEvent) ?? []; + + return { events, cursor, total: res.total }; + }, + { + getNextPageParam: (lastPage) => { + if (lastPage.events.length >= IO_EVENTS_PER_PAGE) { + return { + cursor: lastPage.events[lastPage.events.length - 1]['@timestamp'], + }; + } + }, + refetchOnWindowFocus: false, + refetchOnMount: false, + refetchOnReconnect: false, + } + ); + + return query; +}; + +/** + * flattens all pages of IO events into an array of lines + * note: not efficient currently, tracking a page cursor to avoid redoing work is needed. + */ +export const useIOLines = (pages: ProcessEventsPage[] | undefined) => { + const lines: IOLine[] = useMemo(() => { + const newLines: IOLine[] = []; + + if (!pages) { + return newLines; + } + + return pages.reduce((previous, current) => { + if (current.events) { + current.events.forEach((event) => { + if (event?.process?.io?.text) { + const data: IOLine[] = event.process.io.text.split(/\n\r?/).map((line) => { + return { + value: line, + }; + }); + + previous = previous.concat(data); + } + }); + } + + return previous; + }, newLines); + }, [pages]); + + return lines; +}; + +export interface XtermPlayerDeps { + ref: React.RefObject; + isPlaying: boolean; + lines: IOLine[]; + hasNextPage?: boolean; + fetchNextPage?: () => void; + isFullscreen?: boolean; +} + +export const useXtermPlayer = ({ + ref, + isPlaying, + lines, + hasNextPage, + fetchNextPage, + isFullscreen, +}: XtermPlayerDeps) => { + const { euiTheme } = useEuiTheme(); + const { font, colors } = euiTheme; + const [currentLine, setCurrentLine] = useState(0); + const [userSeeked, setUserSeeked] = useState(false); + const [playSpeed] = useState(DEFAULT_TTY_PLAYSPEED_MS); // potentially configurable + + const [terminal, fitAddon, searchAddon] = useMemo(() => { + const term = new Terminal({ + theme: { + background: 'rgba(0,0,0,0)', + selection: colors.warning, + }, + fontFamily: font.familyCode, + fontSize: 11, + allowTransparency: true, + }); + + const fitInstance = new FitAddon(); + const searchInstance = new SearchAddon(); + + term.loadAddon(fitInstance); + term.loadAddon(searchInstance); + + return [term, fitInstance, searchInstance]; + }, [colors, font]); + + useEffect(() => { + if (ref.current) { + terminal.open(ref.current); + } + }, [terminal, ref]); + + useEffect(() => { + // isFullscreen check is there just to avoid the necessary "unnecessary" react-hook dep + // When isFullscreen changes, e.g goes from false to true and vice versa, we need to call fit. + if (isFullscreen !== undefined) { + fitAddon.fit(); + } + }, [isFullscreen, fitAddon]); + + const render = useCallback( + (lineNumber: number) => { + if (lines.length === 0) { + return; + } + + let linesToPrint; + + if (userSeeked) { + linesToPrint = lines.slice(0, lineNumber); + terminal.clear(); + setUserSeeked(false); + } else { + linesToPrint = [lines[lineNumber]]; + } + + linesToPrint.forEach((line, index) => { + if (line?.value !== undefined) { + terminal.writeln(line.value); + } + }); + }, + [terminal, lines, userSeeked] + ); + + useEffect(() => { + if (isPlaying) { + const timer = setTimeout(() => { + if (!isPlaying) { + return; + } + + if (currentLine < lines.length) { + setCurrentLine(currentLine + 1); + } + }, playSpeed); + + return () => { + clearInterval(timer); + }; + } + }, [lines, currentLine, isPlaying, playSpeed]); + + useEffect(() => { + render(currentLine); + + if (hasNextPage && fetchNextPage && currentLine === lines.length - 1) { + fetchNextPage(); + } + }, [fetchNextPage, currentLine, lines, render, hasNextPage]); + + const seekToLine = useCallback((line) => { + setUserSeeked(true); + setCurrentLine(line); + }, []); + + const search = useCallback( + (query: string, startCol: number) => { + searchAddon.findNext(query, { caseSensitive: false, lastLineOnly: true, startCol }); + }, + [searchAddon] + ); + + const fit = useCallback(() => { + fitAddon.fit(); + }, [fitAddon]); + + return { + terminal, + currentLine, + seekToLine, + search, + fit, + }; +}; diff --git a/x-pack/plugins/session_view/public/components/tty_player/index.test.tsx b/x-pack/plugins/session_view/public/components/tty_player/index.test.tsx new file mode 100644 index 0000000000000..d9fa7baf6e886 --- /dev/null +++ b/x-pack/plugins/session_view/public/components/tty_player/index.test.tsx @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { waitFor } from '@testing-library/react'; +import { sessionViewIOEventsMock } from '../../../common/mocks/responses/session_view_io_events.mock'; +import { AppContextTestRender, createAppRootMockRenderer } from '../../test'; +import { TTYPlayerDeps, TTYPlayer } from '.'; + +describe('TTYPlayer component', () => { + beforeAll(() => { + // https://stackoverflow.com/questions/39830580/jest-test-fails-typeerror-window-matchmedia-is-not-a-function + // xtermjs is using window.matchMedia, which isn't mocked in jest by default. + Object.defineProperty(window, 'matchMedia', { + writable: true, + value: jest.fn().mockImplementation((query) => ({ + matches: false, + media: query, + onchange: null, + addListener: jest.fn(), // Deprecated + removeListener: jest.fn(), // Deprecated + addEventListener: jest.fn(), + removeEventListener: jest.fn(), + dispatchEvent: jest.fn(), + })), + }); + }); + + let render: () => ReturnType; + let renderResult: ReturnType; + let mockedContext: AppContextTestRender; + let mockedApi: AppContextTestRender['coreStart']['http']['get']; + let props: TTYPlayerDeps; + + const waitForApiCall = () => waitFor(() => expect(mockedApi).toHaveBeenCalled()); + + beforeEach(() => { + mockedContext = createAppRootMockRenderer(); + mockedApi = mockedContext.coreStart.http.get; + mockedApi.mockResolvedValue(sessionViewIOEventsMock); + + const mockSessionEntityId = + sessionViewIOEventsMock?.events?.[0]?._source?.process?.entry_leader?.entity_id; + + props = { + sessionEntityId: mockSessionEntityId, + onClose: jest.fn(), + isFullscreen: false, + }; + }); + + describe('When TTYPlayer is mounted', () => { + it('should have a search bar', () => { + renderResult = mockedContext.render(); + expect(renderResult.queryByTestId('sessionView:TTYSearch')).toBeTruthy(); + }); + it('should render container for xtermjs', () => { + renderResult = mockedContext.render(); + expect(renderResult.queryByTestId('sessionView:TTYPlayer')).toBeTruthy(); + }); + it('should have player controls', () => { + renderResult = mockedContext.render(); + expect(renderResult.queryByTestId('sessionView:TTYPlayerControls')).toBeTruthy(); + }); + it('should have rendered an instance of xtermjs', () => { + renderResult = mockedContext.render(); + expect( + renderResult.queryByTestId('sessionView:TTYPlayer')?.querySelector('.terminal.xterm') + ).toBeTruthy(); + }); + it('should have fetched io events', async () => { + renderResult = mockedContext.render(); + + await waitForApiCall(); + }); + }); +}); diff --git a/x-pack/plugins/session_view/public/components/tty_player/index.tsx b/x-pack/plugins/session_view/public/components/tty_player/index.tsx new file mode 100644 index 0000000000000..48dbf82441e42 --- /dev/null +++ b/x-pack/plugins/session_view/public/components/tty_player/index.tsx @@ -0,0 +1,100 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React, { useRef, useState, useCallback, ChangeEvent, MouseEvent } from 'react'; +import { EuiPanel, EuiRange, EuiFlexGroup, EuiFlexItem, EuiButtonIcon } from '@elastic/eui'; +import { TTYSearchBar } from '../tty_search_bar'; +import { useStyles } from './styles'; +import { useFetchIOEvents, useIOLines, useXtermPlayer } from './hooks'; + +export interface TTYPlayerDeps { + sessionEntityId: string; // TODO: we should not load by session id, but instead a combo of process.tty.major+minor, session time range, and host.boot_id (see Rabbitholes section of epic). + onClose(): void; + isFullscreen: boolean; +} + +export const TTYPlayer = ({ sessionEntityId, onClose, isFullscreen }: TTYPlayerDeps) => { + const styles = useStyles(); + const ref = useRef(null); + + const { data, fetchNextPage, hasNextPage } = useFetchIOEvents(sessionEntityId); + const lines = useIOLines(data?.pages); + const [isPlaying, setIsPlaying] = useState(false); + const { search, currentLine, seekToLine } = useXtermPlayer({ + ref, + isPlaying, + lines, + hasNextPage, + fetchNextPage, + isFullscreen, + }); + + const onLineChange = useCallback( + (event: ChangeEvent | MouseEvent) => { + const line = parseInt((event?.target as HTMLInputElement).value || '0', 10); + seekToLine(line); + setIsPlaying(false); + }, + [seekToLine] + ); + + const onTogglePlayback = useCallback(() => { + setIsPlaying(!isPlaying); + }, [isPlaying]); + + return ( +
+ + + + + + + + + + + +
+ + {/* the following will be replaced by a new component */} + + + + + + + + + + +
+ ); +}; diff --git a/x-pack/plugins/session_view/public/components/tty_player/styles.ts b/x-pack/plugins/session_view/public/components/tty_player/styles.ts new file mode 100644 index 0000000000000..c4061c8a64dce --- /dev/null +++ b/x-pack/plugins/session_view/public/components/tty_player/styles.ts @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useMemo } from 'react'; +import { CSSObject, css } from '@emotion/react'; +import { transparentize, useEuiScrollBar } from '@elastic/eui'; +import { useEuiTheme } from '../../hooks'; + +export const useStyles = () => { + const { euiTheme } = useEuiTheme(); + const euiScrollBar = useEuiScrollBar(); + + const cached = useMemo(() => { + const { size, colors, border } = euiTheme; + + const container: CSSObject = { + position: 'absolute', + top: 0, + width: '100%', + height: '100%', + overflow: 'hidden', + borderRadius: size.s, + backgroundColor: colors.ink, + '.euiRangeLevel--warning': { + backgroundColor: transparentize(colors.warning, 0.8), + }, + '.euiRangeLevel--danger': { + backgroundColor: transparentize(colors.danger, 0.8), + }, + '.euiRangeTick,.euiRangeLevel': { + transition: 'left 500ms', + }, + }; + + const terminal: CSSObject = { + width: '100%', + height: 'calc(100% - 142px)', + '.xterm-viewport': css` + ${euiScrollBar} + `, + border: border.thin, + }; + + return { + container, + terminal, + }; + }, [euiScrollBar, euiTheme]); + + return cached; +}; diff --git a/x-pack/plugins/session_view/public/components/tty_player/xterm_search.ts b/x-pack/plugins/session_view/public/components/tty_player/xterm_search.ts new file mode 100644 index 0000000000000..258920319676c --- /dev/null +++ b/x-pack/plugins/session_view/public/components/tty_player/xterm_search.ts @@ -0,0 +1,487 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/** + * Copyright (c) 2017 The xterm.js authors. All rights reserved. + * @license MIT + */ +import { Terminal, IDisposable, ITerminalAddon, ISelectionPosition } from 'xterm'; + +export interface ISearchOptions { + regex?: boolean; + wholeWord?: boolean; + caseSensitive?: boolean; + incremental?: boolean; + lastLineOnly?: boolean; + startCol?: number; +} + +export interface ISearchPosition { + startCol: number; + startRow: number; +} + +export interface ISearchResult { + term: string; + col: number; + row: number; + size: number; +} + +type LineCacheEntry = [ + /** + * The string representation of a line (as opposed to the buffer cell representation). + */ + lineAsString: string, + /** + * The offsets where each line starts when the entry describes a wrapped line. + */ + lineOffsets: number[] +]; + +const LINES_CACHE_TIME_TO_LIVE = 15 * 1000; // 15 secs + +export class SearchAddon implements ITerminalAddon { + private _terminal: Terminal | undefined; + + /** + * translateBufferLineToStringWithWrap is a fairly expensive call. + * We memoize the calls into an array that has a time based ttl. + * _linesCache is also invalidated when the terminal cursor moves. + */ + private _linesCache: LineCacheEntry[] | undefined; + private _linesCacheTimeoutId = 0; + private _cursorMoveListener: IDisposable | undefined; + private _resizeListener: IDisposable | undefined; + + public activate(terminal: Terminal): void { + this._terminal = terminal; + } + + public dispose(): void {} + + /** + * Find the next instance of the term, then scroll to and select it. If it + * doesn't exist, do nothing. + * @param term The search term. + * @param searchOptions Search options. + * @return Whether a result was found. + */ + public findNext(term: string, searchOptions?: ISearchOptions): boolean { + if (!this._terminal) { + throw new Error('Cannot use addon until it has been loaded'); + } + + if (!term || term.length === 0) { + this._terminal.clearSelection(); + return false; + } + + let startCol = 0; + let startRow = 0; + let currentSelection: ISelectionPosition | undefined; + if (this._terminal.hasSelection()) { + const incremental = searchOptions ? searchOptions.incremental : false; + // Start from the selection end if there is a selection + // For incremental search, use existing row + currentSelection = this._terminal.getSelectionPosition()!; + startRow = incremental ? currentSelection.startRow : currentSelection.endRow; + startCol = incremental ? currentSelection.startColumn : currentSelection.endColumn; + } + + if (searchOptions?.lastLineOnly) { + startRow = this._terminal.buffer.active.cursorY - 1; + startCol = searchOptions?.startCol || 0; + } + + this._initLinesCache(); + + const searchPosition: ISearchPosition = { + startRow, + startCol, + }; + + // Search startRow + let result = this._findInLine(term, searchPosition, searchOptions); + + // Search from startRow + 1 to end + if (!result) { + for ( + let y = startRow + 1; + y < this._terminal.buffer.active.baseY + this._terminal.rows; + y++ + ) { + searchPosition.startRow = y; + searchPosition.startCol = 0; + // If the current line is wrapped line, increase index of column to ignore the previous scan + // Otherwise, reset beginning column index to zero with set new unwrapped line index + result = this._findInLine(term, searchPosition, searchOptions); + if (result) { + break; + } + } + } + // If we hit the bottom and didn't search from the very top wrap back up + if (!result && startRow !== 0) { + for (let y = 0; y < startRow; y++) { + searchPosition.startRow = y; + searchPosition.startCol = 0; + result = this._findInLine(term, searchPosition, searchOptions); + if (result) { + break; + } + } + } + + // If there is only one result, wrap back and return selection if it exists. + if (!result && currentSelection) { + searchPosition.startRow = currentSelection.startRow; + searchPosition.startCol = 0; + result = this._findInLine(term, searchPosition, searchOptions); + } + + // Set selection and scroll if a result was found + return this._selectResult(result); + } + + /** + * Find the previous instance of the term, then scroll to and select it. If it + * doesn't exist, do nothing. + * @param term The search term. + * @param searchOptions Search options. + * @return Whether a result was found. + */ + public findPrevious(term: string, searchOptions?: ISearchOptions): boolean { + if (!this._terminal) { + throw new Error('Cannot use addon until it has been loaded'); + } + + if (!term || term.length === 0) { + this._terminal.clearSelection(); + return false; + } + + const isReverseSearch = true; + let startRow = this._terminal.buffer.active.baseY + this._terminal.rows; + let startCol = this._terminal.cols; + let result: ISearchResult | undefined; + const incremental = searchOptions ? searchOptions.incremental : false; + let currentSelection: ISelectionPosition | undefined; + if (this._terminal.hasSelection()) { + currentSelection = this._terminal.getSelectionPosition()!; + // Start from selection start if there is a selection + startRow = currentSelection.startRow; + startCol = currentSelection.startColumn; + } + + if (searchOptions?.lastLineOnly) { + startRow = this._terminal.buffer.active.cursorY - 1; + } + + this._initLinesCache(); + const searchPosition: ISearchPosition = { + startRow, + startCol, + }; + + if (incremental) { + // Try to expand selection to right first. + result = this._findInLine(term, searchPosition, searchOptions, false); + const isOldResultHighlighted = result && result.row === startRow && result.col === startCol; + if (!isOldResultHighlighted) { + // If selection was not able to be expanded to the right, then try reverse search + if (currentSelection) { + searchPosition.startRow = currentSelection.endRow; + searchPosition.startCol = currentSelection.endColumn; + } + result = this._findInLine(term, searchPosition, searchOptions, true); + } + } else { + result = this._findInLine(term, searchPosition, searchOptions, isReverseSearch); + } + + // Search from startRow - 1 to top + if (!result) { + searchPosition.startCol = Math.max(searchPosition.startCol, this._terminal.cols); + for (let y = startRow - 1; y >= 0; y--) { + searchPosition.startRow = y; + result = this._findInLine(term, searchPosition, searchOptions, isReverseSearch); + if (result) { + break; + } + } + } + // If we hit the top and didn't search from the very bottom wrap back down + if (!result && startRow !== this._terminal.buffer.active.baseY + this._terminal.rows) { + for (let y = this._terminal.buffer.active.baseY + this._terminal.rows; y >= startRow; y--) { + searchPosition.startRow = y; + result = this._findInLine(term, searchPosition, searchOptions, isReverseSearch); + if (result) { + break; + } + } + } + + // If there is only one result, return true. + if (!result && currentSelection) return true; + + // Set selection and scroll if a result was found + return this._selectResult(result); + } + + /** + * Sets up a line cache with a ttl + */ + private _initLinesCache(): void { + const terminal = this._terminal!; + if (!this._linesCache) { + this._linesCache = new Array(terminal.buffer.active.length); + this._cursorMoveListener = terminal.onCursorMove(() => this._destroyLinesCache()); + this._resizeListener = terminal.onResize(() => this._destroyLinesCache()); + } + + window.clearTimeout(this._linesCacheTimeoutId); + this._linesCacheTimeoutId = window.setTimeout( + () => this._destroyLinesCache(), + LINES_CACHE_TIME_TO_LIVE + ); + } + + private _destroyLinesCache(): void { + this._linesCache = undefined; + if (this._cursorMoveListener) { + this._cursorMoveListener.dispose(); + this._cursorMoveListener = undefined; + } + if (this._resizeListener) { + this._resizeListener.dispose(); + this._resizeListener = undefined; + } + if (this._linesCacheTimeoutId) { + window.clearTimeout(this._linesCacheTimeoutId); + this._linesCacheTimeoutId = 0; + } + } + + /** + * Searches a line for a search term. Takes the provided terminal line and searches the text line, which may contain + * subsequent terminal lines if the text is wrapped. If the provided line number is part of a wrapped text line that + * started on an earlier line then it is skipped since it will be properly searched when the terminal line that the + * text starts on is searched. + * @param term The search term. + * @param searchPosition The position to start the search. + * @param searchOptions Search options. + * @param isReverseSearch Whether the search should start from the right side of the terminal and search to the left. + * @return The search result if it was found. + */ + protected _findInLine( + term: string, + searchPosition: ISearchPosition, + searchOptions: ISearchOptions = {}, + isReverseSearch: boolean = false + ): ISearchResult | undefined { + const terminal = this._terminal!; + const row = searchPosition.startRow; + const col = searchPosition.startCol; + + // Ignore wrapped lines, only consider on unwrapped line (first row of command string). + const firstLine = terminal.buffer.active.getLine(row); + if (firstLine?.isWrapped) { + if (isReverseSearch) { + searchPosition.startCol += terminal.cols; + return; + } + + // This will iterate until we find the line start. + // When we find it, we will search using the calculated start column. + searchPosition.startRow--; + searchPosition.startCol += terminal.cols; + return this._findInLine(term, searchPosition, searchOptions); + } + let cache = this._linesCache?.[row]; + if (!cache) { + cache = this._translateBufferLineToStringWithWrap(row, true); + if (this._linesCache) { + this._linesCache[row] = cache; + } + } + const [stringLine, offsets] = cache; + + const offset = this._bufferColsToStringOffset(row, col); + const searchTerm = searchOptions.caseSensitive ? term : term.toLowerCase(); + const searchStringLine = searchOptions.caseSensitive ? stringLine : stringLine.toLowerCase(); + + let resultIndex = -1; + if (searchOptions.regex) { + const searchRegex = RegExp(searchTerm, 'g'); + let foundTerm: RegExpExecArray | null; + if (isReverseSearch) { + // This loop will get the resultIndex of the _last_ regex match in the range 0..offset + while ((foundTerm = searchRegex.exec(searchStringLine.slice(0, offset)))) { + resultIndex = searchRegex.lastIndex - foundTerm[0].length; + term = foundTerm[0]; + searchRegex.lastIndex -= term.length - 1; + } + } else { + foundTerm = searchRegex.exec(searchStringLine.slice(offset)); + if (foundTerm && foundTerm[0].length > 0) { + resultIndex = offset + (searchRegex.lastIndex - foundTerm[0].length); + term = foundTerm[0]; + } + } + } else { + if (isReverseSearch) { + if (offset - searchTerm.length >= 0) { + resultIndex = searchStringLine.lastIndexOf(searchTerm, offset - searchTerm.length); + } + } else { + resultIndex = searchStringLine.indexOf(searchTerm, offset); + } + } + + if (resultIndex >= 0) { + // Adjust the row number and search index if needed since a "line" of text can span multiple rows + let startRowOffset = 0; + while (startRowOffset < offsets.length - 1 && resultIndex >= offsets[startRowOffset + 1]) { + startRowOffset++; + } + let endRowOffset = startRowOffset; + while ( + endRowOffset < offsets.length - 1 && + resultIndex + term.length >= offsets[endRowOffset + 1] + ) { + endRowOffset++; + } + const startColOffset = resultIndex - offsets[startRowOffset]; + const endColOffset = resultIndex + term.length - offsets[endRowOffset]; + const startColIndex = this._stringLengthToBufferSize(row + startRowOffset, startColOffset); + const endColIndex = this._stringLengthToBufferSize(row + endRowOffset, endColOffset); + const size = endColIndex - startColIndex + terminal.cols * (endRowOffset - startRowOffset); + + return { + term, + col: startColIndex, + row: row + startRowOffset, + size, + }; + } + } + + private _stringLengthToBufferSize(row: number, offset: number): number { + const line = this._terminal!.buffer.active.getLine(row); + if (!line) { + return 0; + } + for (let i = 0; i < offset; i++) { + const cell = line.getCell(i); + if (!cell) { + break; + } + // Adjust the searchIndex to normalize emoji into single chars + const char = cell.getChars(); + if (char.length > 1) { + offset -= char.length - 1; + } + // Adjust the searchIndex for empty characters following wide unicode + // chars (eg. CJK) + const nextCell = line.getCell(i + 1); + if (nextCell && nextCell.getWidth() === 0) { + offset++; + } + } + return offset; + } + + private _bufferColsToStringOffset(startRow: number, cols: number): number { + const terminal = this._terminal!; + let lineIndex = startRow; + let offset = 0; + let line = terminal.buffer.active.getLine(lineIndex); + while (cols > 0 && line) { + for (let i = 0; i < cols && i < terminal.cols; i++) { + const cell = line.getCell(i); + if (!cell) { + break; + } + if (cell.getWidth()) { + offset += cell.getChars().length; + } + } + lineIndex++; + line = terminal.buffer.active.getLine(lineIndex); + if (line && !line.isWrapped) { + break; + } + cols -= terminal.cols; + } + return offset; + } + + /** + * Translates a buffer line to a string, including subsequent lines if they are wraps. + * Wide characters will count as two columns in the resulting string. This + * function is useful for getting the actual text underneath the raw selection + * position. + * @param lineIndex The line being translated. + * @param trimRight Whether to trim whitespace to the right. + */ + private _translateBufferLineToStringWithWrap( + lineIndex: number, + trimRight: boolean + ): LineCacheEntry { + const terminal = this._terminal!; + const strings = []; + const lineOffsets = [0]; + let line = terminal.buffer.active.getLine(lineIndex); + while (line) { + const nextLine = terminal.buffer.active.getLine(lineIndex + 1); + const lineWrapsToNext = nextLine ? nextLine.isWrapped : false; + let string = line.translateToString(!lineWrapsToNext && trimRight); + if (lineWrapsToNext && nextLine) { + const lastCell = line.getCell(line.length - 1); + const lastCellIsNull = lastCell && lastCell.getCode() === 0 && lastCell.getWidth() === 1; + // a wide character wrapped to the next line + if (lastCellIsNull && nextLine.getCell(0)?.getWidth() === 2) { + string = string.slice(0, -1); + } + } + strings.push(string); + if (lineWrapsToNext) { + lineOffsets.push(lineOffsets[lineOffsets.length - 1] + string.length); + } else { + break; + } + lineIndex++; + line = nextLine; + } + return [strings.join(''), lineOffsets]; + } + + /** + * Selects and scrolls to a result. + * @param result The result to select. + * @return Whethera result was selected. + */ + private _selectResult(result: ISearchResult | undefined): boolean { + const terminal = this._terminal!; + if (!result) { + terminal.clearSelection(); + return false; + } + terminal.select(result.col, result.row, result.size); + // If it is not in the viewport then we scroll else it just gets selected + if ( + result.row >= terminal.buffer.active.viewportY + terminal.rows || + result.row < terminal.buffer.active.viewportY + ) { + let scroll = result.row - terminal.buffer.active.viewportY; + scroll -= Math.floor(terminal.rows / 2); + terminal.scrollLines(scroll); + } + return true; + } +} diff --git a/x-pack/plugins/session_view/public/components/tty_search_bar/index.test.tsx b/x-pack/plugins/session_view/public/components/tty_search_bar/index.test.tsx new file mode 100644 index 0000000000000..4545acf1a4578 --- /dev/null +++ b/x-pack/plugins/session_view/public/components/tty_search_bar/index.test.tsx @@ -0,0 +1,102 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import { renderHook } from '@testing-library/react-hooks'; +import userEvent from '@testing-library/user-event'; +import { fireEvent } from '@testing-library/dom'; +import { AppContextTestRender, createAppRootMockRenderer } from '../../test'; +import { sessionViewIOEventsMock } from '../../../common/mocks/responses/session_view_io_events.mock'; +import { useIOLines } from '../tty_player/hooks'; +import { ProcessEventsPage } from '../../../common/types/process_tree'; +import { TTYSearchBar, TTYSearchBarDeps } from '.'; + +// TTYSearchBar is a HOC to SessionViewSearchBar which is already well tested +// so these tests will only focus on newly added functionality +describe('TTYSearchBar component', () => { + let render: () => ReturnType; + let renderResult: ReturnType; + let mockedContext: AppContextTestRender; + let props: TTYSearchBarDeps; + + beforeEach(() => { + mockedContext = createAppRootMockRenderer(); + + const events = sessionViewIOEventsMock?.events?.map((event) => event._source); + const pages: ProcessEventsPage[] = [{ events, total: events?.length }]; + const { result } = renderHook(() => useIOLines(pages)); + const lines = result.current; + + props = { + lines, + seekToLine: jest.fn(), + xTermSearchFn: jest.fn(), + }; + }); + + it('mounts and renders the search bar', async () => { + renderResult = mockedContext.render(); + expect(renderResult.queryByTestId('sessionView:searchBar')).toBeTruthy(); + }); + + it('does a search when a user enters text and hits enter', async () => { + renderResult = mockedContext.render(); + + const searchInput = renderResult.queryByTestId('sessionView:searchBar')?.querySelector('input'); + if (searchInput) { + userEvent.type(searchInput, '-h'); + fireEvent.keyUp(searchInput, { key: 'Enter', code: 'Enter' }); + } + + expect(props.seekToLine).toHaveBeenCalledTimes(1); + + // there is a slight delay in the seek in xtermjs, so we wait 100ms before trying to highlight a result. + await new Promise((r) => setTimeout(r, 100)); + + expect(props.xTermSearchFn).toHaveBeenCalledTimes(1); + }); + + it('calls seekToline and xTermSearchFn when currentMatch changes', async () => { + renderResult = mockedContext.render(); + + const searchInput = renderResult.queryByTestId('sessionView:searchBar')?.querySelector('input'); + if (searchInput) { + userEvent.type(searchInput, '-h'); + fireEvent.keyUp(searchInput, { key: 'Enter', code: 'Enter' }); + } + + await new Promise((r) => setTimeout(r, 100)); + + userEvent.click(renderResult.getByTestId('pagination-button-next')); + + await new Promise((r) => setTimeout(r, 100)); + + // two calls, first instance -h is at line 22, 2nd at line 42 + expect(props.seekToLine).toHaveBeenCalledTimes(2); + expect(props.seekToLine).toHaveBeenNthCalledWith(1, 22); + expect(props.seekToLine).toHaveBeenNthCalledWith(2, 42); + + expect(props.xTermSearchFn).toHaveBeenCalledTimes(2); + expect(props.xTermSearchFn).toHaveBeenNthCalledWith(1, '-h', 6); + expect(props.xTermSearchFn).toHaveBeenNthCalledWith(2, '-h', 13); + }); + + it('calls xTermSearchFn with empty query when search is cleared', async () => { + renderResult = mockedContext.render(); + + const searchInput = renderResult.queryByTestId('sessionView:searchBar')?.querySelector('input'); + if (searchInput) { + userEvent.type(searchInput, '-h'); + fireEvent.keyUp(searchInput, { key: 'Enter', code: 'Enter' }); + } + + await new Promise((r) => setTimeout(r, 100)); + userEvent.click(renderResult.getByTestId('clearSearchButton')); + await new Promise((r) => setTimeout(r, 100)); + + expect(props.xTermSearchFn).toHaveBeenNthCalledWith(2, '', 0); + }); +}); diff --git a/x-pack/plugins/session_view/public/components/tty_search_bar/index.tsx b/x-pack/plugins/session_view/public/components/tty_search_bar/index.tsx new file mode 100644 index 0000000000000..af60bdf664f9d --- /dev/null +++ b/x-pack/plugins/session_view/public/components/tty_search_bar/index.tsx @@ -0,0 +1,97 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React, { useEffect, useMemo, useState, useCallback } from 'react'; +import { SessionViewSearchBar } from '../session_view_search_bar'; +import { IOLine } from '../../../common/types/process_tree'; + +interface SearchResult { + line: IOLine; + match: string; + index: number; +} + +export interface TTYSearchBarDeps { + lines: IOLine[]; + seekToLine(index: number): void; + xTermSearchFn(query: string, index: number): void; +} + +export const TTYSearchBar = ({ lines, seekToLine, xTermSearchFn }: TTYSearchBarDeps) => { + const [currentMatch, setCurrentMatch] = useState(null); + const [searchQuery, setSearchQuery] = useState(''); + + useEffect(() => { + if (currentMatch) { + const goToLine = lines.indexOf(currentMatch.line); + seekToLine(goToLine); + } + + const timeout = setTimeout(() => { + return xTermSearchFn(searchQuery, currentMatch?.index || 0); + }, 100); + + return () => { + clearTimeout(timeout); + }; + }, [currentMatch, searchQuery, lines, xTermSearchFn, seekToLine]); + + const searchResults = useMemo(() => { + if (searchQuery) { + const matches: SearchResult[] = []; + + lines.reduce((previous: SearchResult[], current: IOLine) => { + if (current.value) { + const regex = new RegExp(searchQuery.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'ig'); + const lineMatches = current.value.matchAll(regex); + if (lineMatches) { + for (const match of lineMatches) { + previous.push({ line: current, match: match[0], index: match.index || 0 }); + } + } + } + + return previous; + }, matches); + + if (matches.length > 0) { + setCurrentMatch(matches[0]); + } else { + setCurrentMatch(null); + } + + return matches; + } + + return []; + }, [searchQuery, lines]); + + const onSearch = useCallback((query) => { + setSearchQuery(query); + setCurrentMatch(null); + }, []); + + const onSetCurrentMatch = useCallback( + (index) => { + const match = searchResults[index]; + + if (match && currentMatch !== match) { + setCurrentMatch(match); + } + }, + [currentMatch, searchResults] + ); + + return ( + + ); +}; diff --git a/x-pack/plugins/session_view/public/methods/index.tsx b/x-pack/plugins/session_view/public/methods/index.tsx index 3654e296e7412..b8a581ea3ba95 100644 --- a/x-pack/plugins/session_view/public/methods/index.tsx +++ b/x-pack/plugins/session_view/public/methods/index.tsx @@ -7,7 +7,7 @@ import React, { lazy, Suspense } from 'react'; import { EuiLoadingSpinner } from '@elastic/eui'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { SessionViewDeps } from '../types'; // Initializing react-query diff --git a/x-pack/plugins/session_view/public/test/index.tsx b/x-pack/plugins/session_view/public/test/index.tsx index 6174925b6003c..244560d366ac4 100644 --- a/x-pack/plugins/session_view/public/test/index.tsx +++ b/x-pack/plugins/session_view/public/test/index.tsx @@ -8,7 +8,7 @@ import React, { memo, ReactNode, useMemo } from 'react'; import { createMemoryHistory, MemoryHistory } from 'history'; import { render as reactRender, RenderOptions, RenderResult } from '@testing-library/react'; -import { QueryClient, QueryClientProvider, setLogger } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Router } from 'react-router-dom'; import { History } from 'history'; import useObservable from 'react-use/lib/useObservable'; @@ -20,15 +20,6 @@ import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; type UiRender = (ui: React.ReactElement, options?: RenderOptions) => RenderResult; -// hide react-query output in console -setLogger({ - error: () => {}, - // eslint-disable-next-line no-console - log: console.log, - // eslint-disable-next-line no-console - warn: console.warn, -}); - /** * Mocked app root context renderer */ @@ -113,6 +104,14 @@ export const createAppRootMockRenderer = (): AppContextTestRender => { cacheTime: Infinity, }, }, + // hide react-query output in console + logger: { + error: () => {}, + // eslint-disable-next-line no-console + log: console.log, + // eslint-disable-next-line no-console + warn: console.warn, + }, }); const AppWrapper: React.FC<{ children: React.ReactElement }> = ({ children }) => ( diff --git a/x-pack/plugins/session_view/public/types.ts b/x-pack/plugins/session_view/public/types.ts index f8a42c0c4660c..d276f0e9518a9 100644 --- a/x-pack/plugins/session_view/public/types.ts +++ b/x-pack/plugins/session_view/public/types.ts @@ -107,15 +107,15 @@ export interface DetailPanelOrchestrator { name: string; type: string; ip: string; + parent: { + type: string; + }; }; namespace: string; cluster: { name: string; id: string; }; - parent: { - type: string; - }; } export interface DetailPanelCloud { diff --git a/x-pack/plugins/session_view/server/routes/get_total_io_bytes_route.ts b/x-pack/plugins/session_view/server/routes/get_total_io_bytes_route.ts new file mode 100644 index 0000000000000..c7371e05d058c --- /dev/null +++ b/x-pack/plugins/session_view/server/routes/get_total_io_bytes_route.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 { schema } from '@kbn/config-schema'; +import { IRouter } from '@kbn/core/server'; +import { EVENT_ACTION } from '@kbn/rule-data-utils'; +import { + GET_TOTAL_IO_BYTES_ROUTE, + PROCESS_EVENTS_INDEX, + ENTRY_SESSION_ENTITY_ID_PROPERTY, + TOTAL_BYTES_CAPTURED_PROPERTY, +} from '../../common/constants'; + +export const registerGetTotalIOBytesRoute = (router: IRouter) => { + router.get( + { + path: GET_TOTAL_IO_BYTES_ROUTE, + validate: { + query: schema.object({ + sessionEntityId: schema.string(), + }), + }, + }, + async (context, request, response) => { + const client = (await context.core).elasticsearch.client.asCurrentUser; + const { sessionEntityId } = request.query; + + try { + const search = await client.search({ + index: [PROCESS_EVENTS_INDEX], + body: { + query: { + bool: { + must: [ + { term: { [ENTRY_SESSION_ENTITY_ID_PROPERTY]: sessionEntityId } }, + { term: { [EVENT_ACTION]: 'text_output' } }, + ], + }, + }, + size: 0, + aggs: { + total_bytes_captured: { + sum: { + field: TOTAL_BYTES_CAPTURED_PROPERTY, + }, + }, + }, + }, + }); + + const agg: any = search.aggregations?.total_bytes_captured; + + return response.ok({ body: agg?.value || 0 }); + } catch (err) { + // unauthorized + if (err.meta.statusCode === 403) { + return response.ok(); + } + + return response.badRequest(err.message); + } + } + ); +}; diff --git a/x-pack/plugins/session_view/server/routes/index.ts b/x-pack/plugins/session_view/server/routes/index.ts index 2955ccdd39327..0e4099fe01cfa 100644 --- a/x-pack/plugins/session_view/server/routes/index.ts +++ b/x-pack/plugins/session_view/server/routes/index.ts @@ -9,9 +9,13 @@ import { RuleRegistryPluginStartContract } from '@kbn/rule-registry-plugin/serve import { registerProcessEventsRoute } from './process_events_route'; import { registerAlertsRoute } from './alerts_route'; import { registerAlertStatusRoute } from './alert_status_route'; +import { registerIOEventsRoute } from './io_events_route'; +import { registerGetTotalIOBytesRoute } from './get_total_io_bytes_route'; export const registerRoutes = (router: IRouter, ruleRegistry: RuleRegistryPluginStartContract) => { registerProcessEventsRoute(router, ruleRegistry); registerAlertsRoute(router, ruleRegistry); registerAlertStatusRoute(router, ruleRegistry); + registerIOEventsRoute(router); + registerGetTotalIOBytesRoute(router); }; diff --git a/x-pack/plugins/session_view/server/routes/io_events_route.ts b/x-pack/plugins/session_view/server/routes/io_events_route.ts new file mode 100644 index 0000000000000..c03035a8b36a7 --- /dev/null +++ b/x-pack/plugins/session_view/server/routes/io_events_route.ts @@ -0,0 +1,66 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { schema } from '@kbn/config-schema'; +import { IRouter } from '@kbn/core/server'; +import { EVENT_ACTION } from '@kbn/rule-data-utils'; +import { + IO_EVENTS_ROUTE, + IO_EVENTS_PER_PAGE, + PROCESS_EVENTS_INDEX, + ENTRY_SESSION_ENTITY_ID_PROPERTY, +} from '../../common/constants'; + +export const registerIOEventsRoute = (router: IRouter) => { + router.get( + { + path: IO_EVENTS_ROUTE, + validate: { + query: schema.object({ + sessionEntityId: schema.string(), + cursor: schema.maybe(schema.string()), + }), + }, + }, + async (context, request, response) => { + const client = (await context.core).elasticsearch.client.asCurrentUser; + const { cursor } = request.query; + const { sessionEntityId } = request.query; + + try { + const search = await client.search({ + index: [PROCESS_EVENTS_INDEX], + body: { + query: { + bool: { + must: [ + { term: { [ENTRY_SESSION_ENTITY_ID_PROPERTY]: sessionEntityId } }, + { term: { [EVENT_ACTION]: 'text_output' } }, + ], + }, + }, + size: IO_EVENTS_PER_PAGE, + sort: [{ '@timestamp': 'asc' }], + search_after: cursor ? [cursor] : undefined, + }, + }); + + const events = search.hits.hits; + const total = + typeof search.hits.total === 'number' ? search.hits.total : search.hits.total?.value; + + return response.ok({ body: { total, events } }); + } catch (err) { + // unauthorized + if (err.meta.statusCode === 403) { + return response.ok({ body: { total: 0, events: [] } }); + } + + return response.badRequest(err.message); + } + } + ); +}; diff --git a/x-pack/plugins/session_view/server/routes/process_events_route.ts b/x-pack/plugins/session_view/server/routes/process_events_route.ts index 2bb1aa4579ec9..614c7ad135e73 100644 --- a/x-pack/plugins/session_view/server/routes/process_events_route.ts +++ b/x-pack/plugins/session_view/server/routes/process_events_route.ts @@ -12,6 +12,7 @@ import type { AlertsClient, RuleRegistryPluginStartContract, } from '@kbn/rule-registry-plugin/server'; +import { EVENT_ACTION } from '@kbn/rule-data-utils'; import { ALERTS_PER_PROCESS_EVENTS_PAGE, PROCESS_EVENTS_ROUTE, @@ -77,8 +78,13 @@ export const fetchEventsAndScopedAlerts = async ( index: [PROCESS_EVENTS_INDEX], body: { query: { - match: { - [ENTRY_SESSION_ENTITY_ID_PROPERTY]: sessionEntityId, + bool: { + must: [{ term: { [ENTRY_SESSION_ENTITY_ID_PROPERTY]: sessionEntityId } }], + should: [ + { term: { [EVENT_ACTION]: 'fork' } }, + { term: { [EVENT_ACTION]: 'exec' } }, + { term: { [EVENT_ACTION]: 'end' } }, + ], }, }, size: PROCESS_EVENTS_PER_PAGE, diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/geo_containment.test.ts b/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/geo_containment.test.ts index 098ad0530af8d..85b5adc8a2020 100644 --- a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/geo_containment.test.ts +++ b/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/tests/geo_containment.test.ts @@ -40,6 +40,7 @@ const alertFactory = (contextKeys: unknown[], testAlertActionArr: unknown[]) => ); return alertInstance; }, + hasReachedAlertLimit: () => false, done: () => ({ getRecoveredAlerts: () => [] }), }); diff --git a/x-pack/plugins/synthetics/e2e/journeys/alerts/default_email_settings.ts b/x-pack/plugins/synthetics/e2e/journeys/alerts/default_email_settings.ts index f2504e690965f..ce19d8442d056 100644 --- a/x-pack/plugins/synthetics/e2e/journeys/alerts/default_email_settings.ts +++ b/x-pack/plugins/synthetics/e2e/journeys/alerts/default_email_settings.ts @@ -43,7 +43,6 @@ journey('DefaultEmailSettings', async ({ page, params }) => { }); step('clear existing settings', async () => { - await settings.dismissSyntheticsCallout(); await page.waitForSelector(byTestId('"default-connectors-input-loaded"')); await page.waitForTimeout(10 * 1000); const toEmailInput = await page.$(byTestId('toEmailAddressInput')); diff --git a/x-pack/plugins/synthetics/e2e/journeys/step_duration.journey.ts b/x-pack/plugins/synthetics/e2e/journeys/step_duration.journey.ts index 1193409d0df94..ba62da5d4a4d7 100644 --- a/x-pack/plugins/synthetics/e2e/journeys/step_duration.journey.ts +++ b/x-pack/plugins/synthetics/e2e/journeys/step_duration.journey.ts @@ -30,7 +30,6 @@ journey('StepsDuration', async ({ page, params }) => { }); step('Go to monitor details', async () => { - await page.click('text=Dismiss'); await page.click('button:has-text("test-monitor - inline")'); expect(page.url()).toBe(`${baseUrl}/monitor/dGVzdC1tb25pdG9yLWlubGluZQ==/?${queryParams}`); }); diff --git a/x-pack/plugins/synthetics/e2e/journeys/synthetics/getting_started.journey.ts b/x-pack/plugins/synthetics/e2e/journeys/synthetics/getting_started.journey.ts index 40035e9c70923..2d9f1f888a936 100644 --- a/x-pack/plugins/synthetics/e2e/journeys/synthetics/getting_started.journey.ts +++ b/x-pack/plugins/synthetics/e2e/journeys/synthetics/getting_started.journey.ts @@ -46,8 +46,4 @@ journey(`Getting Started Page`, async ({ page, params }: { page: Page; params: a await createBasicMonitor(); await syntheticsApp.confirmAndSave(); }); - - step('it navigates to details page after saving', async () => { - await page.click('text=Dismiss'); - }); }); diff --git a/x-pack/plugins/synthetics/e2e/journeys/uptime.journey.ts b/x-pack/plugins/synthetics/e2e/journeys/uptime.journey.ts index 5896b609cf76d..15cca32983e1d 100644 --- a/x-pack/plugins/synthetics/e2e/journeys/uptime.journey.ts +++ b/x-pack/plugins/synthetics/e2e/journeys/uptime.journey.ts @@ -28,12 +28,6 @@ journey('uptime', ({ page, params }) => { await page.click('[data-test-subj=loginSubmit]'); }); - step('dismiss synthetics notice', async () => { - await page.click('[data-test-subj=uptimeDismissSyntheticsCallout]', { - timeout: 60 * 1000, - }); - }); - step('change uptime index pattern', async () => { await page.click(byTestId('settings-page-link')); diff --git a/x-pack/plugins/synthetics/e2e/page_objects/utils.tsx b/x-pack/plugins/synthetics/e2e/page_objects/utils.tsx index 024609e2f69ef..74fa8f6c8ce54 100644 --- a/x-pack/plugins/synthetics/e2e/page_objects/utils.tsx +++ b/x-pack/plugins/synthetics/e2e/page_objects/utils.tsx @@ -19,12 +19,6 @@ export function utilsPageProvider({ page }: { page: Page }) { } }, - async dismissSyntheticsCallout() { - await page.click('[data-test-subj=uptimeDismissSyntheticsCallout]', { - timeout: 60 * 1000, - }); - }, - async assertText({ text }: { text: string }) { await page.waitForSelector(`text=${text}`); expect(await page.$(`text=${text}`)).toBeTruthy(); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_details_link.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_details_link.tsx index c17112ce68aa9..8a92811b9b5c8 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_details_link.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_details_link.tsx @@ -13,6 +13,7 @@ import { ConfigKey, EncryptedSyntheticsSavedMonitor, } from '../../../../../../../common/runtime_types'; +import { useMonitorDetailLocator } from '../../hooks/use_monitor_detail_locator'; export const MonitorDetailsLink = ({ basePath, @@ -30,13 +31,11 @@ export const MonitorDetailsLink = ({ const locationId = lastSelectedLocationId && monitorHasLocation ? lastSelectedLocationId : firstMonitorLocationId; - const locationUrlQueryParam = locationId ? `?locationId=${locationId}` : ''; + const monitorDetailLinkUrl = useMonitorDetailLocator({ monitorId: monitor.id, locationId }); return ( <> - - {monitor.name} - + {monitor.name} ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.test.tsx new file mode 100644 index 0000000000000..af6799068c278 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.test.tsx @@ -0,0 +1,152 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { fireEvent } from '@testing-library/react'; +import { render } from '../../../../utils/testing/rtl_helpers'; +import { ActionsPopover } from './actions_popover'; +import * as editMonitorLocatorModule from '../../hooks/use_edit_monitor_locator'; +import * as monitorDetailLocatorModule from '../../hooks/use_monitor_detail_locator'; +import * as monitorEnableHandlerModule from '../../../../hooks/use_monitor_enable_handler'; +import { FETCH_STATUS } from '@kbn/observability-plugin/public'; +import { MonitorOverviewItem } from '../types'; + +describe('ActionsPopover', () => { + let testMonitor: MonitorOverviewItem; + + beforeEach(() => { + testMonitor = { + location: { + id: 'us_central', + isServiceManaged: true, + }, + isEnabled: true, + name: 'Monitor 1', + id: 'somelongstring', + }; + }); + + afterEach(() => { + jest.restoreAllMocks(); + }); + + it('renders the popover button', () => { + const { queryByText, getByLabelText } = render( + + ); + expect(getByLabelText('Open actions menu')); + expect(queryByText('Actions')).not.toBeInTheDocument(); + }); + + it('opens the popover on click', async () => { + const setIsPopoverOpen = jest.fn(); + const isPopoverOpen = false; + const { getByLabelText } = render( + + ); + const popoverButton = getByLabelText('Open actions menu'); + fireEvent.click(popoverButton); + expect(setIsPopoverOpen).toHaveBeenCalled(); + // the popover passes back a function that accepts a bool and returns the inverse, + // so we're calling it here just to make sure the behavior is correct + expect(setIsPopoverOpen.mock.calls[0][0](isPopoverOpen)).toBe(true); + }); + + it('closes the popover on subsequent click', async () => { + const setIsPopoverOpen = jest.fn(); + const isPopoverOpen = true; + const { getByLabelText } = render( + + ); + const popoverButton = getByLabelText('Open actions menu'); + fireEvent.click(popoverButton); + expect(setIsPopoverOpen).toHaveBeenCalled(); + // the popover passes back a function that accepts a bool and returns the inverse, + // so we're calling it here just to make sure the behavior is correct + expect(setIsPopoverOpen.mock.calls[0][0](isPopoverOpen)).toBe(false); + }); + + it('contains link to edit page', async () => { + jest + .spyOn(editMonitorLocatorModule, 'useEditMonitorLocator') + .mockReturnValue('/a/test/edit/url'); + const { getByRole } = render( + + ); + expect(getByRole('link')?.getAttribute('href')).toBe('/a/test/edit/url'); + }); + + it('contains link to detail page', async () => { + jest + .spyOn(monitorDetailLocatorModule, 'useMonitorDetailLocator') + .mockReturnValue('/a/test/detail/url'); + const { getByRole } = render( + + ); + expect(getByRole('link')?.getAttribute('href')).toBe('/a/test/detail/url'); + }); + + it('sets the enabled state', async () => { + const updateMonitorEnabledState = jest.fn(); + jest.spyOn(monitorEnableHandlerModule, 'useMonitorEnableHandler').mockReturnValue({ + status: FETCH_STATUS.SUCCESS, + isEnabled: true, + updateMonitorEnabledState, + }); + const { getByText } = render( + + ); + const enableButton = getByText('Disable monitor'); + fireEvent.click(enableButton); + expect(updateMonitorEnabledState).toHaveBeenCalledTimes(1); + expect(updateMonitorEnabledState.mock.calls[0]).toEqual([ + { + id: 'somelongstring', + isEnabled: true, + location: { id: 'us_central', isServiceManaged: true }, + name: 'Monitor 1', + }, + false, + ]); + }); + + it('sets enabled state to true', async () => { + const updateMonitorEnabledState = jest.fn(); + jest.spyOn(monitorEnableHandlerModule, 'useMonitorEnableHandler').mockReturnValue({ + status: FETCH_STATUS.PENDING, + isEnabled: null, + updateMonitorEnabledState, + }); + const { getByText } = render( + + ); + const enableButton = getByText('Enable monitor'); + fireEvent.click(enableButton); + expect(updateMonitorEnabledState).toHaveBeenCalledTimes(1); + expect(updateMonitorEnabledState.mock.calls[0]).toEqual([ + { + id: 'somelongstring', + isEnabled: false, + location: { id: 'us_central', isServiceManaged: true }, + name: 'Monitor 1', + }, + true, + ]); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.tsx new file mode 100644 index 0000000000000..932c6344c4716 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.tsx @@ -0,0 +1,220 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { EuiPopover, EuiButtonIcon, EuiContextMenu, useEuiShadow } from '@elastic/eui'; +import { FETCH_STATUS } from '@kbn/observability-plugin/public'; +import { useTheme } from '@kbn/observability-plugin/public'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import styled from 'styled-components'; +import { MonitorOverviewItem } from '../../../../../../../common/runtime_types'; +import { useMonitorEnableHandler } from '../../../../hooks/use_monitor_enable_handler'; +import { quietFetchOverviewAction } from '../../../../state/overview/actions'; +import { selectOverviewState } from '../../../../state/overview/selectors'; +import { useEditMonitorLocator } from '../../hooks/use_edit_monitor_locator'; +import { useMonitorDetailLocator } from '../../hooks/use_monitor_detail_locator'; + +interface ActionContainerProps { + boxShadow: string; +} + +const ActionContainer = styled.div` + // position + display: inline-block; + position: relative; + bottom: 42px; + left: 12px; + z-index: 1; + + // style + border-radius: ${({ theme }) => theme.eui.euiBorderRadius}; + ${({ boxShadow }) => boxShadow} +`; + +export function ActionsPopover({ + isPopoverOpen, + setIsPopoverOpen, + monitor, +}: { + isPopoverOpen: boolean; + monitor: MonitorOverviewItem; + setIsPopoverOpen: React.Dispatch>; +}) { + const theme = useTheme(); + const euiShadow = useEuiShadow('l'); + const dispatch = useDispatch(); + const { pageState } = useSelector(selectOverviewState); + + const detailUrl = useMonitorDetailLocator({ + monitorId: monitor.id, + locationId: monitor.location.id, + }); + const editUrl = useEditMonitorLocator({ monitorId: monitor.id }); + + const labels = useMemo( + () => ({ + enabledSuccessLabel: enabledSuccessLabel(monitor.name), + disabledSuccessLabel: disabledSuccessLabel(monitor.name), + failureLabel: enabledFailLabel(monitor.name), + }), + [monitor.name] + ); + const { status, isEnabled, updateMonitorEnabledState } = useMonitorEnableHandler({ + id: monitor.id, + reloadPage: useCallback(() => { + dispatch(quietFetchOverviewAction.get(pageState)); + setIsPopoverOpen(false); + }, [dispatch, pageState, setIsPopoverOpen]), + labels, + }); + + const [enableLabel, setEnableLabel] = useState( + monitor.isEnabled ? disableMonitorLabel : enableMonitorLabel + ); + + useEffect(() => { + if (status === FETCH_STATUS.LOADING) { + setEnableLabel(enableLabelLoading); + } else if (status === FETCH_STATUS.SUCCESS) { + setEnableLabel(isEnabled ? disableMonitorLabel : enableMonitorLabel); + } + }, [setEnableLabel, status, isEnabled, monitor.isEnabled]); + + return ( + + setIsPopoverOpen((b: boolean) => !b)} + /> + } + color="lightestShade" + isOpen={isPopoverOpen} + closePopover={() => setIsPopoverOpen(false)} + anchorPosition="rightUp" + panelPaddingSize="none" + > + { + if (status !== FETCH_STATUS.LOADING) + updateMonitorEnabledState(monitor, !monitor.isEnabled); + }, + }, + ], + }, + ]} + /> + + + ); +} + +const openActionsMenuAria = i18n.translate( + 'xpack.synthetics.overview.actions.openPopover.ariaLabel', + { + defaultMessage: 'Open actions menu', + } +); + +const actionsMenuTitle = i18n.translate('xpack.synthetics.overview.actions.menu.title', { + defaultMessage: 'Actions', + description: 'This is the text in the heading of a menu containing a set of actions', +}); + +const actionsMenuGoToMonitorName = i18n.translate( + 'xpack.synthetics.overview.actions.goToMonitor.name', + { + defaultMessage: 'Go to monitor', + description: + 'This is the text for a menu item that will take the user to the monitor detail page', + } +); + +const actionsMenuEditMonitorName = i18n.translate( + 'xpack.synthetics.overview.actions.editMonitor.name', + { + defaultMessage: 'Edit monitor', + description: + 'This is the text for a menu item that will take the user to the monitor edit page', + } +); + +const enableLabelLoading = i18n.translate('xpack.synthetics.overview.actions.enableLabel', { + defaultMessage: 'Loading...', +}); + +const enableMonitorLabel = i18n.translate( + 'xpack.synthetics.overview.actions.enableLabelEnableMonitor', + { + defaultMessage: 'Enable monitor', + } +); + +const disableMonitorLabel = i18n.translate( + 'xpack.synthetics.overview.actions.enableLabelDisableMonitor', + { + defaultMessage: 'Disable monitor', + } +); + +const enabledSuccessLabel = (name: string) => + i18n.translate('xpack.synthetics.overview.actions.enabledSuccessLabel', { + defaultMessage: 'Monitor "{name}" enabled successfully', + values: { name }, + }); + +export const disabledSuccessLabel = (name: string) => + i18n.translate('xpack.synthetics.overview.actions.disabledSuccessLabel', { + defaultMessage: 'Monitor "{name}" disabled successfully.', + values: { name }, + }); + +export const enabledFailLabel = (name: string) => + i18n.translate('xpack.synthetics.overview.actions.enabledFailLabel', { + defaultMessage: 'Unable to update monitor "{name}".', + values: { name }, + }); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx index 3348f529fe799..755777bad04ea 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx @@ -4,15 +4,16 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React from 'react'; import { i18n } from '@kbn/i18n'; +import React, { useState } from 'react'; import { Chart, Settings, Metric, MetricTrendShape } from '@elastic/charts'; import { EuiPanel, EuiLoadingChart } from '@elastic/eui'; import { DARK_THEME } from '@elastic/charts'; import { useTheme } from '@kbn/observability-plugin/public'; import { useLocationName, useStatusByLocation } from '../../../../hooks'; import { formatDuration } from '../../../../utils/formatting'; -import { Ping } from '../../../../../../../common/runtime_types'; +import { MonitorOverviewItem, Ping } from '../../../../../../../common/runtime_types'; +import { ActionsPopover } from './actions_popover'; export const getColor = (theme: ReturnType, isEnabled: boolean, ping?: Ping) => { if (!isEnabled) { @@ -24,24 +25,20 @@ export const getColor = (theme: ReturnType, isEnabled: boolean, }; export const MetricItem = ({ - monitorId, - locationId, - monitorName, - isMonitorEnabled, + monitor, averageDuration, data, loaded, }: { - monitorId: string; - locationId: string; - monitorName: string; - isMonitorEnabled: boolean; + monitor: MonitorOverviewItem; data: Array<{ x: number; y: number }>; averageDuration: number; loaded: boolean; }) => { - const locationName = useLocationName({ locationId }); - const { locations } = useStatusByLocation(monitorId); + const [isMouseOver, setIsMouseOver] = useState(false); + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + const locationName = useLocationName({ locationId: monitor.location?.id }); + const { locations } = useStatusByLocation(monitor.id); const ping = locations.find((loc) => loc.observer?.geo?.name === locationName); const theme = useTheme(); @@ -53,6 +50,16 @@ export const MetricItem = ({ > {loaded ? ( { + if (!isMouseOver) { + setIsMouseOver(true); + } + }} + onMouseLeave={() => { + if (isMouseOver) { + setIsMouseOver(false); + } + }} style={{ padding: '0px', height: '100%', @@ -62,11 +69,11 @@ export const MetricItem = ({ ), valueFormatter: (d: number) => formatDuration(d), - color: getColor(theme, isMonitorEnabled, ping), + color: getColor(theme, monitor.isEnabled, ping), }, ], ]} /> + {(isMouseOver || isPopoverOpen) && ( + + )} ) : ( diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx index 24059c6e90330..898e68ba84001 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx @@ -40,12 +40,7 @@ export const OverviewGrid = () => { key={`${monitor.id}-${monitor.location?.id}`} data-test-subj="syntheticsOverviewGridItem" > - + ))} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item.tsx index b11534b096f91..d9141c5cbeb85 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item.tsx @@ -7,28 +7,14 @@ import React from 'react'; import { MetricItem } from './metric_item'; import { useLast50DurationChart } from '../../../../hooks'; +import { MonitorOverviewItem } from '../../../../../../../common/runtime_types'; -export const OverviewGridItem = ({ - monitorId, - monitorName, - locationId, - isMonitorEnabled, -}: { - monitorId: string; - monitorName: string; - locationId: string; - isMonitorEnabled: boolean; -}) => { - const { data, loading, averageDuration } = useLast50DurationChart({ locationId, monitorId }); +export const OverviewGridItem = ({ monitor }: { monitor: MonitorOverviewItem }) => { + const { data, loading, averageDuration } = useLast50DurationChart({ + locationId: monitor.location?.id, + monitorId: monitor.id, + }); return ( - + ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_last_50_duration_chart.ts b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_last_50_duration_chart.ts index 6bfd3616e8654..a543c146ec82b 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_last_50_duration_chart.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_last_50_duration_chart.ts @@ -37,7 +37,7 @@ export function useLast50DurationChart({ const coords = hits .reverse() // results are returned in desc order by timestamp. Reverse to ensure the data is in asc order by timestamp .map((hit, index) => { - const duration = hit['monitor.duration.us']?.[0]; + const duration = hit?.['monitor.duration.us']?.[0]; totalDuration += duration || 0; if (duration === undefined) { return null; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx index e1703654f8538..6fed27f2df6b5 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx @@ -9,7 +9,11 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; import { FETCH_STATUS } from '@kbn/observability-plugin/public'; import React, { useCallback, useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { ConfigKey, EncryptedSyntheticsMonitor } from '../components/monitors_page/overview/types'; +import { + ConfigKey, + EncryptedSyntheticsMonitor, + MonitorOverviewItem, +} from '../components/monitors_page/overview/types'; import { clearMonitorUpsertStatus, fetchUpsertMonitorAction, @@ -37,7 +41,7 @@ export function useMonitorEnableHandler({ const savedObjEnabledState = upsertStatuses[id]?.enabled; const [isEnabled, setIsEnabled] = useState(null); const updateMonitorEnabledState = useCallback( - (monitor: EncryptedSyntheticsMonitor, enabled: boolean) => { + (monitor: EncryptedSyntheticsMonitor | MonitorOverviewItem, enabled: boolean) => { dispatch( fetchUpsertMonitorAction({ id, @@ -82,5 +86,5 @@ export function useMonitorEnableHandler({ savedObjEnabledState, ]); - return { isEnabled, setIsEnabled, updateMonitorEnabledState, status }; + return { isEnabled, updateMonitorEnabledState, status }; } diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts index bd65a771de531..3315719a6bb16 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts @@ -10,6 +10,7 @@ import { createAction } from '@reduxjs/toolkit'; import { EncryptedSyntheticsMonitor, MonitorManagementListResult, + MonitorOverviewItem, } from '../../../../../common/runtime_types'; import { createAsyncAction } from '../utils/actions'; @@ -22,7 +23,7 @@ export const fetchMonitorListAction = createAsyncAction< export interface UpsertMonitorRequest { id: string; - monitor: EncryptedSyntheticsMonitor; + monitor: EncryptedSyntheticsMonitor | MonitorOverviewItem; } export const fetchUpsertMonitorAction = createAction('fetchUpsertMonitor'); export const fetchUpsertSuccessAction = createAction<{ diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/api.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/api.ts index 97d60011e35d4..5e4e2e1bc1a67 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/api.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/api.ts @@ -11,6 +11,7 @@ import { FetchMonitorManagementListQueryArgs, MonitorManagementListResult, MonitorManagementListResultCodec, + MonitorOverviewItem, ServiceLocationErrors, SyntheticsMonitor, } from '../../../../../common/runtime_types'; @@ -54,7 +55,7 @@ export const fetchUpsertMonitor = async ({ monitor, id, }: { - monitor: SyntheticsMonitor | EncryptedSyntheticsMonitor; + monitor: SyntheticsMonitor | EncryptedSyntheticsMonitor | MonitorOverviewItem; id?: string; }): Promise<{ attributes: { errors: ServiceLocationErrors } } | SyntheticsMonitor> => { if (id) { diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts b/x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts index af51f39786898..64d72aa248d78 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts @@ -9,12 +9,12 @@ import { i18n } from '@kbn/i18n'; import { useContext } from 'react'; import { useSelector } from 'react-redux'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { NoDataConfig } from '@kbn/shared-ux-page-kibana-template'; import { UptimeSettingsContext } from '../contexts'; import { ClientPluginsStart } from '../../plugin'; import { indexStatusSelector } from '../state/selectors'; -export function useNoDataConfig(): KibanaPageTemplateProps['noDataConfig'] { +export function useNoDataConfig(): NoDataConfig | undefined { const { basePath } = useContext(UptimeSettingsContext); const { diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/custom_fields.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/custom_fields.test.tsx index e4e55b96f09dc..f9a02507f5ec3 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/custom_fields.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/custom_fields.test.tsx @@ -251,9 +251,7 @@ describe('', () => { expect(node).toBeInTheDocument(); }); expect( - getByText( - /To create a "Browser" monitor, please ensure you are using the elastic-agent-complete Docker container, which contains the dependencies to run these mon/ - ) + getByText(/To create a "Browser" monitor, please ensure you are using the/) ).toBeInTheDocument(); // expect tls options to be available for browser diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/custom_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/custom_fields.tsx index 1d6c2a085ec68..e600c8067cc9a 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/custom_fields.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/custom_fields.tsx @@ -16,6 +16,7 @@ import { EuiSpacer, EuiSwitch, EuiCallOut, + EuiCode, EuiLink, } from '@elastic/eui'; import { DescribedFormGroupWithWrap } from './common/described_form_group_with_wrap'; @@ -154,27 +155,32 @@ export const CustomFields = memo( - - - ), - }} + id="xpack.synthetics.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.monitorType.browser.warning.title" + defaultMessage="Requirement" /> } - iconType="help" size="s" - /> + > + elastic-agent-complete, + link: ( + + + + ), + }} + /> + )} {renderSimpleFields(monitorType)} diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/add_location_flyout.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/add_location_flyout.tsx index f49bbf10a9afc..d1d9eb03c01f6 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/add_location_flyout.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/add_location_flyout.tsx @@ -15,7 +15,6 @@ import { EuiFlyoutBody, EuiFlyoutFooter, EuiFlyoutHeader, - EuiSpacer, EuiTitle, EuiFlyout, EuiButton, @@ -77,8 +76,6 @@ export const AddLocationFlyout = ({

{NEED_FLEET_READ_AGENT_POLICIES_PERMISSION}

)} - - diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/empty_locations.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/empty_locations.tsx index c110a8ce6a07c..d30dcb2d7db42 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/empty_locations.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/empty_locations.tsx @@ -26,10 +26,11 @@ export const EmptyLocations = ({ {ADD_FIRST_LOCATION}} + titleSize="s" body={ -

+ {!inFlyout ? FIRST_MONITOR : ''} {START_ADDING_LOCATIONS_DESCRIPTION} -

+ } actions={ + + +

+ { + elastic-agent-complete, + link: ( + + + + ), + }} + /> + } +

+
); }; +export const AGENT_CALLOUT_TITLE = i18n.translate( + 'xpack.synthetics.monitorManagement.agentCallout.title', + { + defaultMessage: 'Requirement', + } +); + export const LOCATION_NAME_LABEL = i18n.translate( 'xpack.synthetics.monitorManagement.locationName', { diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/manage_locations_flyout.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/manage_locations_flyout.tsx index fc8f7d9b1c2f0..103a9a37480db 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/manage_locations_flyout.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/manage_locations_flyout.tsx @@ -78,7 +78,7 @@ export const ManageLocationsFlyout = () => { const flyout = ( - +

{PRIVATE_LOCATIONS}

diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/policy_hosts.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/policy_hosts.tsx index 7188a896ef4b5..7a1d59e611e6b 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/policy_hosts.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/manage_locations/policy_hosts.tsx @@ -91,7 +91,7 @@ export const PolicyHostsField = ({ @@ -126,6 +126,13 @@ const SELECT_POLICY_HOSTS = i18n.translate('xpack.synthetics.monitorManagement.s defaultMessage: 'Select agent policy', }); +const SELECT_POLICY_HOSTS_HELP_TEXT = i18n.translate( + 'xpack.synthetics.monitorManagement.selectPolicyHost.helpText', + { + defaultMessage: 'We recommend using a single Elastic agent per agent policy.', + } +); + const POLICY_HOST_LABEL = i18n.translate('xpack.synthetics.monitorManagement.policyHost', { defaultMessage: 'Agent policy', }); diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/synthetics_callout.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/synthetics_callout.test.tsx deleted file mode 100644 index d5b82a562be3b..0000000000000 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/synthetics_callout.test.tsx +++ /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 { shallowWithIntl } from '@kbn/test-jest-helpers'; -import React from 'react'; -import { SyntheticsCallout } from './synthetics_callout'; - -describe('SyntheticsCallout', () => { - let setItemMock; - let localStorageMock: any; - - beforeEach(() => { - setItemMock = jest.fn(); - localStorageMock = { - getItem: jest.fn().mockImplementation(() => null), - setItem: setItemMock, - }; - - global.localStorage = localStorageMock; - }); - - it('renders component if dismissal flag is unset', () => { - expect(shallowWithIntl()).toMatchInlineSnapshot(` - - -

- -

- - - - - - - - - - - - -
-
- `); - }); - - it('returns null if callout has been dismissed', () => { - localStorageMock.getItem = jest.fn().mockImplementation(() => 'true'); - expect(shallowWithIntl()).toEqual({}); - }); - - it('renders the component, and then returns null when dismiss button clicked', () => { - localStorageMock.getItem = jest - .fn() - .mockImplementationOnce(() => null) - .mockImplementationOnce(() => 'true'); - const wrapper = shallowWithIntl(); - expect(wrapper).toMatchInlineSnapshot(` - - -

- -

- - - - - - - - - - - - -
-
- `); - wrapper.find('EuiButton').simulate('click'); - expect(wrapper).toEqual({}); - }); -}); diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/synthetics_callout.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/synthetics_callout.tsx deleted file mode 100644 index a6c4f06d31c27..0000000000000 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/synthetics_callout.tsx +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiButton, EuiButtonEmpty, EuiCallOut, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import React, { useState } from 'react'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; - -const SYNTHETICS_CALLOUT_LS_KEY = 'xpack.uptime.syntheticsCallout.display'; -const shouldShowSyntheticsCallout = () => { - let value = localStorage.getItem(SYNTHETICS_CALLOUT_LS_KEY); - if (value === null) { - localStorage.setItem(SYNTHETICS_CALLOUT_LS_KEY, 'true'); - value = 'true'; - } - return value === 'true'; -}; -const hideSyntheticsCallout = () => localStorage.setItem(SYNTHETICS_CALLOUT_LS_KEY, 'false'); - -export const SyntheticsCallout = () => { - const [shouldShow, setShouldShow] = useState(shouldShowSyntheticsCallout()); - if (!shouldShow) { - return null; - } - return ( - <> - -

- -

- - - - - - - - { - if (shouldShow) { - hideSyntheticsCallout(); - setShouldShow(false); - } - }} - > - - - - -
- - ); -}; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/settings_bottom_bar.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/settings_bottom_bar.tsx index b080c3ea89712..99d672b24dd74 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/settings_bottom_bar.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/settings_bottom_bar.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { OutPortal, createPortalNode, InPortal } from 'react-reverse-portal'; +import { OutPortal, createHtmlPortalNode, InPortal } from 'react-reverse-portal'; import { SettingsActions, SettingsActionsProps } from './settings_actions'; export const SettingsBottomBar = () => { @@ -24,4 +24,4 @@ export const SettingsActionBarPortal = (props: SettingsActionsProps) => { ); }; -export const SettingsBarPortalNode = createPortalNode(); +export const SettingsBarPortalNode = createHtmlPortalNode(); diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap index 5bac7ff7caf76..febc67e115ef9 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap +++ b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap @@ -148,6 +148,7 @@ exports[`useUrlParams deletes keys that do not have truthy values 1`] = ` Array [], Array [], Array [], + Array [], ], "results": Array [ Object { @@ -174,6 +175,12 @@ exports[`useUrlParams deletes keys that do not have truthy values 1`] = ` "selectedFilters": null, }, }, + Object { + "type": "return", + "value": Object { + "selectedFilters": null, + }, + }, ], }, "replaceReducer": [MockFunction], @@ -378,6 +385,7 @@ exports[`useUrlParams gets the expected values using the context 1`] = ` Array [], Array [], Array [], + Array [], ], "results": Array [ Object { @@ -404,6 +412,12 @@ exports[`useUrlParams gets the expected values using the context 1`] = ` "selectedFilters": null, }, }, + Object { + "type": "return", + "value": Object { + "selectedFilters": null, + }, + }, ], }, "replaceReducer": [MockFunction], diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/portals.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/portals.tsx index 2ca83d1f6972f..b4574d2a5c6d3 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/portals.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/portals.tsx @@ -5,10 +5,10 @@ * 2.0. */ -import { createPortalNode } from 'react-reverse-portal'; +import { createHtmlPortalNode } from 'react-reverse-portal'; -export const ActionBarPortalNode = createPortalNode(); +export const ActionBarPortalNode = createHtmlPortalNode(); -export const APIKeysPortalNode = createPortalNode(); +export const APIKeysPortalNode = createHtmlPortalNode(); -export const ManageLocationsPortalNode = createPortalNode(); +export const ManageLocationsPortalNode = createHtmlPortalNode(); diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/routes.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/routes.tsx index b32144750705b..6fd6ee19534b5 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/routes.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/routes.tsx @@ -49,7 +49,6 @@ import { MonitorPageTitle, MonitorPageTitleContent } from './components/monitor/ import { UptimeDatePicker } from './components/common/uptime_date_picker'; import { CertRefreshBtn } from './components/certificates/cert_refresh_btn'; import { CertificateTitle } from './components/certificates/certificate_title'; -import { SyntheticsCallout } from './components/overview/synthetics_callout'; import { StepDetailPageChildren, StepDetailPageHeader, @@ -314,7 +313,6 @@ export const PageRouter: FC = () => { }) => (
- { login(); }); -/** - * Time range extended to 15 years back to ensure fixtures are showing up correctly - * TODO: https://github.com/elastic/security-team/issues/4595 - */ -const THREAT_INTELLIGENCE_15Y_DATA = - '/app/security/threat_intelligence/indicators?indicators=(filterQuery:(language:kuery,query:%27%27),filters:!(),timeRange:(from:now-15y/d,to:now))'; +const THREAT_INTELLIGENCE = '/app/security/threat_intelligence/indicators'; const URL_WITH_CONTRADICTORY_FILTERS = '/app/security/threat_intelligence/indicators?indicators=(filterQuery:(language:kuery,query:%27%27),filters:!((%27$state%27:(store:appState),meta:(alias:!n,disabled:!f,index:%27%27,key:threat.indicator.type,negate:!f,params:(query:file),type:phrase),query:(match_phrase:(threat.indicator.type:file))),(%27$state%27:(store:appState),meta:(alias:!n,disabled:!f,index:%27%27,key:threat.indicator.type,negate:!f,params:(query:url),type:phrase),query:(match_phrase:(threat.indicator.type:url)))),timeRange:(from:now/d,to:now/d))'; @@ -51,7 +49,9 @@ describe('Indicators', () => { describe('Indicators page basics', () => { before(() => { - cy.visit(THREAT_INTELLIGENCE_15Y_DATA); + cy.visit(THREAT_INTELLIGENCE); + + selectRange(); }); it('should render the basic page elements', () => { @@ -90,7 +90,9 @@ describe('Indicators', () => { describe('Indicator page search', () => { before(() => { - cy.visit(THREAT_INTELLIGENCE_15Y_DATA); + cy.visit(THREAT_INTELLIGENCE); + + selectRange(); }); it('should narrow the results to url indicators when respective KQL search is executed', () => { @@ -121,10 +123,12 @@ describe('Indicators', () => { }); describe('No items match search criteria', () => { - before(() => + before(() => { // Contradictory filter set - cy.visit(URL_WITH_CONTRADICTORY_FILTERS) - ); + cy.visit(URL_WITH_CONTRADICTORY_FILTERS); + + selectRange(); + }); it('should not display the table when contractictory filters are set', () => { cy.get(FLYOUT_TABLE).should('not.exist'); @@ -147,4 +151,20 @@ describe('Indicators', () => { cy.get(`${FIELD_SELECTOR}`).should('have.value', threatIndicatorIp); }); }); + + describe('Field browser', () => { + before(() => { + cy.visit(THREAT_INTELLIGENCE); + + selectRange(); + }); + + describe('when field browser is triggered', () => { + it('should render proper modal window', () => { + cy.get(FIELD_BROWSER).last().click({ force: true }); + + cy.get(FIELD_BROWSER_MODAL).should('be.visible'); + }); + }); + }); }); diff --git a/x-pack/plugins/threat_intelligence/cypress/screens/indicators.ts b/x-pack/plugins/threat_intelligence/cypress/screens/indicators.ts index 3c68050c58f8c..f5ab5f46f687d 100644 --- a/x-pack/plugins/threat_intelligence/cypress/screens/indicators.ts +++ b/x-pack/plugins/threat_intelligence/cypress/screens/indicators.ts @@ -38,3 +38,11 @@ export const TABLE_CONTROLS = '[data-test-sub="dataGridControls"]'; export const INDICATOR_TYPE_CELL = '[data-gridcell-column-id="threat.indicator.type"]'; export const FIELD_SELECTOR = '[data-test-subj="tiIndicatorFieldSelectorDropdown"]'; + +export const FIELD_BROWSER = `[data-test-subj="show-field-browser"]`; + +export const FIELD_BROWSER_MODAL = `[data-test-subj="fields-browser-container"]`; + +export const FIELD_BROWSER_MODAL_SOURCE_CHECKBOX = `[data-test-subj="field-_source-checkbox"]`; + +export const FIELD_BROWSER_CLOSE = `[data-test-subj="close"]`; diff --git a/x-pack/plugins/threat_intelligence/cypress/tasks/select_range.ts b/x-pack/plugins/threat_intelligence/cypress/tasks/select_range.ts new file mode 100644 index 0000000000000..8bf94c7f920ee --- /dev/null +++ b/x-pack/plugins/threat_intelligence/cypress/tasks/select_range.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 { FIELD_BROWSER, TIME_RANGE_PICKER } from '../screens/indicators'; + +export const selectRange = () => { + cy.get(FIELD_BROWSER); + + cy.get(TIME_RANGE_PICKER).first().click({ force: true }); + cy.get('[aria-label="Time unit"]').select('y'); + cy.get('[data-test-subj="superDatePickerQuickMenu"] .euiQuickSelect__applyButton').click({ + force: true, + }); +}; diff --git a/x-pack/plugins/threat_intelligence/kibana.json b/x-pack/plugins/threat_intelligence/kibana.json index 18493feca7c4f..efd1e8bce761e 100644 --- a/x-pack/plugins/threat_intelligence/kibana.json +++ b/x-pack/plugins/threat_intelligence/kibana.json @@ -3,6 +3,7 @@ "version": "1.0.0", "kibanaVersion": "kibana", "ui": true, + "server": false, "owner": { "name": "Protections Experience Team", "githubTeam": "protections-experience" @@ -14,7 +15,8 @@ "unifiedSearch", "kibanaUtils", "navigation", - "kibanaReact" + "kibanaReact", + "triggersActionsUi" ], "requiredBundles": [ "data", diff --git a/x-pack/plugins/threat_intelligence/public/common/mocks/mock_kibana_data_service.tsx b/x-pack/plugins/threat_intelligence/public/common/mocks/mock_kibana_data_service.tsx deleted file mode 100644 index c002343369988..0000000000000 --- a/x-pack/plugins/threat_intelligence/public/common/mocks/mock_kibana_data_service.tsx +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { Observable } from 'rxjs'; -import { TimeRangeBounds } from '@kbn/data-plugin/common'; -import * as hook from '../../hooks/use_kibana'; - -export interface MockSearchServiceParams { - searchSubject?: Observable; - calculateSubject?: TimeRangeBounds; -} - -export const mockKibanaDataService = ({ - searchSubject, - calculateSubject, -}: MockSearchServiceParams) => { - const search = jest.fn().mockReturnValue(searchSubject); - const showError = jest.fn(); - const getUiSetting = jest.fn(); - const calculateBounds = jest.fn().mockReturnValue(calculateSubject); - - (hook as jest.Mocked).useKibana.mockReturnValue({ - services: { - data: { - search: { search, showError }, - query: { timefilter: { timefilter: { calculateBounds } } }, - }, - uiSettings: { get: getUiSetting }, - }, - } as any); - - return { - search, - showError, - getUiSetting, - calculateBounds, - }; -}; diff --git a/x-pack/plugins/threat_intelligence/public/common/mocks/mock_use_kibana_for_filters.ts b/x-pack/plugins/threat_intelligence/public/common/mocks/mock_use_kibana_for_filters.ts index cb77e0cec5523..598bec07732a0 100644 --- a/x-pack/plugins/threat_intelligence/public/common/mocks/mock_use_kibana_for_filters.ts +++ b/x-pack/plugins/threat_intelligence/public/common/mocks/mock_use_kibana_for_filters.ts @@ -42,7 +42,6 @@ export const mockUseKibanaForFilters = ({ }, }, dataViews: { getFieldsForWildcard }, - uiSettings: { get: () => ['mock-index'] }, }, } as any); diff --git a/x-pack/plugins/threat_intelligence/public/common/mocks/test_providers.tsx b/x-pack/plugins/threat_intelligence/public/common/mocks/test_providers.tsx index 019587c4b30fb..afd526342689b 100644 --- a/x-pack/plugins/threat_intelligence/public/common/mocks/test_providers.tsx +++ b/x-pack/plugins/threat_intelligence/public/common/mocks/test_providers.tsx @@ -13,9 +13,10 @@ import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import type { IStorage } from '@kbn/kibana-utils-plugin/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; +import { BehaviorSubject } from 'rxjs'; import { mockUiSetting } from './mock_kibana_ui_setting'; -import { KibanaContextProvider } from '../../hooks/use_kibana'; -import { Services, ThreatIntelligenceSecuritySolutionContext } from '../../types'; +import { KibanaContext } from '../../hooks/use_kibana'; +import { SecuritySolutionPluginContext } from '../../types'; import { SecuritySolutionContext } from '../../containers/security_solution_context'; export const localStorageMock = (): IStorage => { @@ -51,6 +52,7 @@ export const unifiedSearch = unifiedSearchPluginMock.createStartContract(); const validDate: string = '1 Jan 2022 00:00:00 GMT'; const data = dataPluginMock.createStartContract(); + const dataServiceMock = { ...data, query: { @@ -83,20 +85,7 @@ const dataServiceMock = { }, search: { ...data.search, - search: jest.fn().mockImplementation(() => ({ - subscribe: jest.fn().mockImplementation(() => ({ - error: jest.fn(), - next: jest.fn(), - unsubscribe: jest.fn(), - })), - pipe: jest.fn().mockImplementation(() => ({ - subscribe: jest.fn().mockImplementation(() => ({ - error: jest.fn(), - next: jest.fn(), - unsubscribe: jest.fn(), - })), - })), - })), + search: jest.fn().mockReturnValue(new BehaviorSubject({})), }, }; @@ -106,7 +95,7 @@ const coreServiceMock = { uiSettings: { get: jest.fn().mockImplementation(mockUiSetting) }, }; -const mockSecurityContext: ThreatIntelligenceSecuritySolutionContext = { +const mockSecurityContext: SecuritySolutionPluginContext = { getFiltersGlobalComponent: () => ({ children }) => @@ -116,19 +105,36 @@ const mockSecurityContext: ThreatIntelligenceSecuritySolutionContext = { return true; }, }, + sourcererDataView: { + browserFields: {}, + selectedPatterns: [], + indexPattern: { fields: [], title: '' }, + }, }; -const mockedServices = { +export const mockedServices = { ...coreServiceMock, data: dataServiceMock, storage, unifiedSearch, -} as unknown as Services; + triggersActionsUi: { + getFieldBrowser: jest.fn().mockReturnValue(null), + }, +}; export const TestProvidersComponent: FC = ({ children }) => ( - + {children} - + ); + +export type MockedSearch = jest.Mocked; +export type MockedTimefilter = jest.Mocked; +export type MockedTriggersActionsUi = jest.Mocked; + +export const mockedSearchService = mockedServices.data.search as MockedSearch; +export const mockedTimefilterService = mockedServices.data.query.timefilter as MockedTimefilter; +export const mockedTriggersActionsUiService = + mockedServices.triggersActionsUi as MockedTriggersActionsUi; diff --git a/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard/enterprise_guard.test.tsx b/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard/enterprise_guard.test.tsx index bb4739bb6251f..4c0abd97f154d 100644 --- a/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard/enterprise_guard.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard/enterprise_guard.test.tsx @@ -7,7 +7,7 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; -import { ThreatIntelligenceSecuritySolutionContext } from '../../types'; +import { SecuritySolutionPluginContext } from '../../types'; import { SecuritySolutionContext } from '../security_solution_context'; import { EnterpriseGuard } from './enterprise_guard'; @@ -19,7 +19,7 @@ describe('', () => { value={ { licenseService: { isEnterprise: jest.fn().mockReturnValue(true) }, - } as unknown as ThreatIntelligenceSecuritySolutionContext + } as unknown as SecuritySolutionPluginContext } > @@ -39,7 +39,7 @@ describe('', () => { value={ { licenseService: { isEnterprise: jest.fn().mockReturnValue(false) }, - } as unknown as ThreatIntelligenceSecuritySolutionContext + } as unknown as SecuritySolutionPluginContext } > fallback for non enterprise
}> diff --git a/x-pack/plugins/threat_intelligence/public/containers/security_solution_context.tsx b/x-pack/plugins/threat_intelligence/public/containers/security_solution_context.tsx index 0dae7e9538c38..91a2934463d07 100644 --- a/x-pack/plugins/threat_intelligence/public/containers/security_solution_context.tsx +++ b/x-pack/plugins/threat_intelligence/public/containers/security_solution_context.tsx @@ -6,8 +6,8 @@ */ import { createContext } from 'react'; -import { ThreatIntelligenceSecuritySolutionContext } from '../types'; +import { SecuritySolutionPluginContext } from '../types'; -export const SecuritySolutionContext = createContext< - ThreatIntelligenceSecuritySolutionContext | undefined ->(undefined); +export const SecuritySolutionContext = createContext( + undefined +); diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_kibana.ts b/x-pack/plugins/threat_intelligence/public/hooks/use_kibana.ts index 28e15734e6dcc..a6431c3c40a8f 100644 --- a/x-pack/plugins/threat_intelligence/public/hooks/use_kibana.ts +++ b/x-pack/plugins/threat_intelligence/public/hooks/use_kibana.ts @@ -5,9 +5,13 @@ * 2.0. */ -import { KibanaContextProvider, useKibana } from '@kbn/kibana-react-plugin/public'; +import { + KibanaContextProvider, + useKibana, + context as KibanaContext, +} from '@kbn/kibana-react-plugin/public'; import { Services } from '../types'; const useTypedKibana = () => useKibana(); -export { KibanaContextProvider, useTypedKibana as useKibana }; +export { KibanaContextProvider, useTypedKibana as useKibana, KibanaContext }; diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_security_context.ts b/x-pack/plugins/threat_intelligence/public/hooks/use_security_context.ts index 433f12bf548c0..4d5fad34baf09 100644 --- a/x-pack/plugins/threat_intelligence/public/hooks/use_security_context.ts +++ b/x-pack/plugins/threat_intelligence/public/hooks/use_security_context.ts @@ -7,9 +7,9 @@ import { useContext } from 'react'; import { SecuritySolutionContext } from '../containers/security_solution_context'; -import { ThreatIntelligenceSecuritySolutionContext } from '../types'; +import { SecuritySolutionPluginContext } from '../types'; -export const useSecurityContext = (): ThreatIntelligenceSecuritySolutionContext => { +export const useSecurityContext = (): SecuritySolutionPluginContext => { const contextValue = useContext(SecuritySolutionContext); if (!contextValue) { diff --git a/x-pack/plugins/threat_intelligence/public/index.ts b/x-pack/plugins/threat_intelligence/public/index.ts index 3751d0d0f7003..539b807426341 100755 --- a/x-pack/plugins/threat_intelligence/public/index.ts +++ b/x-pack/plugins/threat_intelligence/public/index.ts @@ -24,5 +24,5 @@ export function plugin() { export type { ThreatIntelligencePluginSetup, ThreatIntelligencePluginStart, - ThreatIntelligenceSecuritySolutionContext, + SecuritySolutionPluginContext, } from './types'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.stories.tsx index cda6671d03fda..1f4cbce1c76a2 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.stories.tsx @@ -23,20 +23,18 @@ export default { }; const mockTimeRange: TimeRange = DEFAULT_TIME_RANGE; -const mockIndexPatterns: DataView[] = [ - { - fields: [ - { - name: '@timestamp', - type: 'date', - } as DataViewField, - { - name: 'threat.feed.name', - type: 'string', - } as DataViewField, - ], - } as DataView, -]; +const mockIndexPattern: DataView = { + fields: [ + { + name: '@timestamp', + type: 'date', + } as DataViewField, + { + name: 'threat.feed.name', + type: 'string', + } as DataViewField, + ], +} as DataView; const validDate: string = '1 Jan 2022 00:00:00 GMT'; const numberOfDays: number = 1; @@ -107,7 +105,7 @@ const KibanaReactContext = createKibanaReactContext({ export const Default: Story = () => { return ( - + ); }; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.test.tsx index 39afea8a11a0e..b8f06c06aa6f5 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.test.tsx @@ -13,27 +13,25 @@ import { TestProvidersComponent } from '../../../../common/mocks/test_providers' import { IndicatorsBarChartWrapper } from './indicators_barchart_wrapper'; import { DEFAULT_TIME_RANGE } from '../../hooks/use_filters/utils'; -const mockIndexPatterns: DataView[] = [ - { - fields: [ - { - name: '@timestamp', - type: 'date', - } as DataViewField, - { - name: 'threat.feed.name', - type: 'string', - } as DataViewField, - ], - } as DataView, -]; +const mockIndexPatterns: DataView = { + fields: [ + { + name: '@timestamp', + type: 'date', + } as DataViewField, + { + name: 'threat.feed.name', + type: 'string', + } as DataViewField, + ], +} as DataView; const mockTimeRange: TimeRange = DEFAULT_TIME_RANGE; describe('', () => { it('should render barchart and field selector dropdown', () => { const component = render( - + ); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.tsx index 0988e50dc0007..a30bdffe0e23c 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.tsx @@ -8,8 +8,8 @@ import React, { memo } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { DataView } from '@kbn/data-views-plugin/common'; import { TimeRange } from '@kbn/es-query'; +import { SecuritySolutionDataViewBase } from '../../../../types'; import { RawIndicatorFieldId } from '../../../../../common/types/indicator'; import { useAggregatedIndicators } from '../../hooks/use_aggregated_indicators'; import { IndicatorsFieldSelector } from '../indicators_field_selector/indicators_field_selector'; @@ -19,11 +19,11 @@ const DEFAULT_FIELD = RawIndicatorFieldId.Feed; export interface IndicatorsBarChartWrapperProps { timeRange?: TimeRange; - indexPatterns: DataView[]; + indexPattern: SecuritySolutionDataViewBase; } export const IndicatorsBarChartWrapper = memo( - ({ timeRange, indexPatterns }) => { + ({ timeRange, indexPattern }) => { const { dateRange, indicators, onFieldChange } = useAggregatedIndicators({ timeRange }); return ( @@ -41,7 +41,7 @@ export const IndicatorsBarChartWrapper = memo( diff --git a/x-pack/plugins/lens/public/assets/annotation_icons/index.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/index.tsx similarity index 75% rename from x-pack/plugins/lens/public/assets/annotation_icons/index.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/index.tsx index 9e641d495582f..8fefebf88e799 100644 --- a/x-pack/plugins/lens/public/assets/annotation_icons/index.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/index.tsx @@ -5,5 +5,4 @@ * 2.0. */ -export { IconCircle } from './circle'; -export { IconTriangle } from './triangle'; +export * from './indicators_field_browser'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.test.tsx new file mode 100644 index 0000000000000..29e97062cf22d --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.test.tsx @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + mockedTriggersActionsUiService, + TestProvidersComponent, +} from '../../../../common/mocks/test_providers'; +import { render } from '@testing-library/react'; +import React from 'react'; +import { IndicatorsFieldBrowser } from './indicators_field_browser'; + +const stub = jest.fn(); + +describe('', () => { + it('should retrieve the field browser widget from respective service', () => { + render( + , + { + wrapper: TestProvidersComponent, + } + ); + + expect(mockedTriggersActionsUiService.getFieldBrowser).toHaveBeenCalledTimes(1); + expect(mockedTriggersActionsUiService.getFieldBrowser).toHaveBeenCalledWith( + expect.objectContaining({ + browserFields: {}, + columnIds: [], + onResetColumns: stub, + onToggleColumn: stub, + options: {}, + }) + ); + }); +}); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.tsx new file mode 100644 index 0000000000000..2adcc4ee5b9ee --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.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 { BrowserField } from '@kbn/triggers-actions-ui-plugin/public/application/sections/field_browser/types'; +import { VFC } from 'react'; +import { useKibana } from '../../../../hooks/use_kibana'; + +export interface IndicatorsFieldBrowserProps { + browserFields: Readonly>>; + columnIds: string[]; + onResetColumns: () => void; + onToggleColumn: (columnId: string) => void; +} + +export const IndicatorsFieldBrowser: VFC = ({ + browserFields, + columnIds, + onResetColumns, + onToggleColumn, +}) => { + const { triggersActionsUi } = useKibana().services; + + return triggersActionsUi.getFieldBrowser({ + browserFields, + columnIds, + onResetColumns, + onToggleColumn, + options: {}, + }); +}; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.stories.tsx index f7bb3300334a5..94ca9f903aec6 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.stories.tsx @@ -11,20 +11,18 @@ import { DataView, DataViewField } from '@kbn/data-views-plugin/common'; import { RawIndicatorFieldId } from '../../../../../common/types/indicator'; import { IndicatorsFieldSelector } from './indicators_field_selector'; -const mockIndexPatterns: DataView[] = [ - { - fields: [ - { - name: '@timestamp', - type: 'date', - } as DataViewField, - { - name: 'threat.feed.name', - type: 'string', - } as DataViewField, - ], - } as DataView, -]; +const mockIndexPattern: DataView = { + fields: [ + { + name: '@timestamp', + type: 'date', + } as DataViewField, + { + name: 'threat.feed.name', + type: 'string', + } as DataViewField, + ], +} as DataView; export default { component: IndicatorsFieldSelector, @@ -34,7 +32,7 @@ export default { export const Default: Story = () => { return ( console.log(value)} /> @@ -44,7 +42,7 @@ export const Default: Story = () => { export const WithDefaultValue: Story = () => { return ( console.log(value)} defaultStackByValue={RawIndicatorFieldId.LastSeen} @@ -55,7 +53,7 @@ export const WithDefaultValue: Story = () => { export const NoData: Story = () => { return ( console.log(value)} /> diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.test.tsx index 21a0f56dfb36a..e3bd4129d4fc5 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.test.tsx @@ -11,27 +11,25 @@ import { DataView, DataViewField } from '@kbn/data-views-plugin/common'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; import { DROPDOWN_TEST_ID, IndicatorsFieldSelector } from './indicators_field_selector'; -const mockIndexPatterns: DataView[] = [ - { - fields: [ - { - name: '@timestamp', - type: 'date', - } as DataViewField, - { - name: 'threat.feed.name', - type: 'string', - } as DataViewField, - ], - } as DataView, -]; +const mockIndexPattern: DataView = { + fields: [ + { + name: '@timestamp', + type: 'date', + } as DataViewField, + { + name: 'threat.feed.name', + type: 'string', + } as DataViewField, + ], +} as DataView; describe('', () => { it('should handle empty array of indexPatterns', () => { const component = render( console.log(value)} /> @@ -45,7 +43,7 @@ describe('', () => { const component = render( console.log(value)} /> @@ -56,7 +54,7 @@ describe('', () => { const dropdownOptions: string = component.getByTestId(DROPDOWN_TEST_ID).innerHTML; const optionsCount: number = (dropdownOptions.match(/